| name | file-search |
| description | Fast file-name and content search using fd and ripgrep (rg). Provides efficient file system search capabilities with modern CLI tools. |
| tags | ["search","files","fd","ripgrep","rg","cli"] |
| version | 1.0.0 |
| author | xejrax |
| source | https://clawhub.ai/xejrax/file-search |
| requirements | ["fd-find","ripgrep"] |
File Search
Fast file-name and content search using fd and ripgrep (rg).
Purpose
This skill provides efficient file system search capabilities using two modern CLI tools:
| Tool | Purpose |
|---|
fd | Fast file-name search (alternative to find) |
rg | Fast content search (alternative to grep) |
Installation
Fedora/RHEL (dnf)
sudo dnf install fd-find ripgrep
Ubuntu/Debian (apt)
sudo apt install fd-find ripgrep
macOS (brew)
brew install fd ripgrep
Arch Linux (pacman)
sudo pacman -S fd ripgrep
fd — File Name Search
Basic Usage
fd "pattern"
fd "pattern" /path/to/search
fd -i "pattern"
fd -x "exact_name"
File Type Filters
fd -t f "pattern"
fd -t d "pattern"
fd -t x "pattern"
fd -t l "pattern"
Extension Filters
fd -e py "pattern"
fd -e py -e js "pattern"
fd -t f -e py ""
Hidden and Ignored Files
fd -H "pattern"
fd -I "pattern"
fd -HI "pattern"
Size and Time Filters
fd -S +100M
fd -S -1k
fd --changed-within 7d
fd --changed-before 30d
ripgrep (rg) — Content Search
Basic Usage
rg "pattern"
rg "pattern" /path/to/search
rg -i "pattern"
rg -w "pattern"
File Type Filters
rg -t py "pattern"
rg -t js "pattern"
rg -T py "pattern"
rg --type-list
Output Control
rg -l "pattern"
rg -c "pattern"
rg -n "pattern"
rg -N "pattern"
rg -C 2 "pattern"
rg -o "pattern"
Hidden and Ignored Files
rg --hidden "pattern"
rg --no-ignore "pattern"
rg --hidden --no-ignore "pattern"
Regex Features
rg -P "pattern"
rg -F "literal.string"
rg -U "line1.*\n.*line2"
Common Patterns
Find All Python Files
fd -t f -e py ""
Search for TODO in Code
rg -i "TODO|FIXME|XXX" -t py
Find Large Files
fd -S +100M -t f
Find Recently Modified Files
fd --changed-within 1d
Search for Specific Function
rg "def function_name" -t py
Find Empty Directories
fd -t d -e ""
Search and Replace Preview
rg "old_pattern" -r "new_pattern"
When to Use This Skill
- User asks to find files by name
- User needs to search file contents
- Fast file system navigation needed
- Code search in projects
- Finding large or old files
- Searching with regex patterns
Security Notes
- These tools will read files you point them at
- Be careful when searching sensitive directories
- Use
--max-depth to limit search scope
- Review results before acting on them
Comparison with Traditional Tools
| Feature | fd vs find | rg vs grep |
|---|
| Speed | fd is faster (parallel) | rg is faster (parallel) |
| Defaults | fd ignores hidden/gitignore by default | rg ignores hidden/gitignore by default |
| Output | fd has colored output | rg has colored output |
| Regex | fd uses regex by default | rg uses regex by default |
| Typing | fd is shorter to type | rg is shorter to type |