ggrep is a fast, recursive grep‑like command‑line utility written in Rust that avoids shell glob limits and large argument lists. It searches files under a directory prefix for a pattern (regex or fixed string) and supports the familiar grep flags for inversion, counting, file listing, and word matching.
- Recursive file traversal using
walkdir - Regex or literal (fixed‑string) search via
regex - Case‑insensitive matching (
-i/--ignore-case) - Invert match to show non‑matching lines (
-v/--invert-match) - Count matches per file (
-c/--count) - List only file names with matches (
-l/--list-files) - Whole‑word matching (
-w/--word-regexp) - Configurable color highlighting (
--color auto|always|never) - Skips binary files automatically
Make sure you have Rust and Cargo installed (via rustup). Then:
cargo install ggrepAlternatively, to build from source:
git clone https://github.com/DevElCuy/ggrep.git
cd ggrep
cargo build --release
# Optionally install:
cargo install --path .ggrep [OPTIONS] <keyword> [prefix]
<keyword>: Pattern to search for (interpreted as regex by default)[prefix]: Directory to start searching (defaults to.)
-h, --help Print help information
-V, --version Print version information
-i, --ignore-case Case-insensitive search
-v, --invert-match Show lines that do *not* match
-c, --count Print count of matching lines per file
-l, --list-files Print only file names with matches
-F, --fixed-strings Treat pattern as a literal string, not regex
-w, --word-regexp Match whole words only
--color <mode> Colorize matches: auto, always, or never (default: auto)
Search current directory for the regex fn main (case‑insensitive, highlight matches):
ggrep -i "fn main" .Count occurrences of TODO in all files under src/:
ggrep -c TODO src/List files under /var/log that do not contain the literal error:
ggrep -v -l -F error /var/logMatch the whole word unsafe in .rs files (no regex):
ggrep -w -F unsafe src/Always disable coloring (even in a terminal):
ggrep --color never FIXMEContributions, issues, and feature requests are welcome!
- Fork the repository
- Create a new branch (
git checkout -b feature-name) - Commit your changes (
git commit -m "Add feature-name") - Push to the branch (
git push origin feature-name) - Open a pull request
Please format code with cargo fmt and check for warnings with cargo clippy before submitting.
Licensed under MIT OR Apache‑2.0. See LICENSE for details.