A command-line utility for recursively searching and listing files with advanced filtering capabilities. Built in Rust.
-
Advanced Search
- Regex, plain text, and whole-word matching
- Recursive directory traversal
- Binary file detection
- Extension filtering
- Size limits
-
File Listing
- Detailed/simple output formats
- Extension statistics
- Size filtering
- Hidden file handling
-
Utilities
- Clipboard copy support
- Dry-run mode
- Logging to file
- Progress indicators
Assuming you have Rust installed, run:
cargo install rfgrep
cargo install --git https://github.com/kh3rld/rfgrep.git
git clone https://github.com/kh3rld/rfgrep.git
cargo build --release
rfgrep search "pattern"
rfgrep search "pattern" \
--mode regex \
--extensions rs,toml \
--max-size 5 \
--skip-binary \
--copy
# Simple list
rfgrep list
# Detailed view
rfgrep list --long --recursive
# With filters
rfgrep list --extensions rs,toml --max-size 10 --show-hidden
Option | Description |
---|---|
--log PATH |
Write logs to specified file |
--path DIR |
Base directory (default: . ) |
Option | Description |
---|---|
--mode MODE |
Search mode: regex/text/word |
--extensions EXT |
Comma-separated file extensions |
--max-size MB |
Skip files larger than specified MB |
--skip-binary |
Skip binary files |
--dry-run |
Preview files without processing |
--copy |
Copy results to clipboard |
Option | Description |
---|---|
--extensions EXT |
Comma-separated file extensions |
--long |
Detailed output format |
--recursive |
Recursive directory traversal |
--show-hidden |
Include hidden files/directories |
--max-size MB |
Skip files larger than specified MB |
--skip-binary |
Skip binary files |
- Find all Rust files containing "HashMap":
rfgrep search "HashMap" --extensions rs
- List all Markdown files under 1MB:
rfgrep list --extensions md --max-size 1
- Search with regex and copy to clipboard:
rfgrep search "fn\s+\w+\s*\(" --mode regex --copy
- Use
--skip-binary
to avoid unnecessary file checks - Limit scope with
--extensions
and--max-size
- For large directories,
--dry-run
first to preview
Contributions are welcome! Please open an issue or PR for any:
- Bug reports
- Feature requests
- Performance improvements