| created | "2025-12-16T00:00:00.000Z" |
| modified | "2026-05-04T00:00:00.000Z" |
| reviewed | "2026-04-25T00:00:00.000Z" |
| name | fd-file-finding |
| description | fd fast file finding: smart defaults, gitignore-aware, parallel. Use when searching for files by name, extension, or pattern across directories. |
| user-invocable | false |
| allowed-tools | Bash, Read, Grep, Glob |
| model | sonnet |
fd File Finding
Expert knowledge for using fd as a fast, user-friendly alternative to find with smart defaults and powerful filtering.
When to Use This Skill
| Use this skill when... | Use rg-code-search instead when... |
|---|
| Finding files by name, extension, or path pattern | Searching inside file contents for text or regex |
Filtering by mtime (--changed-within) or size (--size) | Filtering matches by file type (-t py, -t js) |
Locating files to feed into -x / -X execution | Auditing source code for patterns across many files |
| Use this skill when... | Use jq-json-processing instead when... |
|---|
| Discovering JSON, YAML, or other files on disk | Querying or transforming the contents of those files |
| Building a file list for downstream batch processing | Extracting fields, filtering arrays, or reshaping JSON |
Core Expertise
fd Advantages
- Fast parallel execution (written in Rust)
- Colorized output by default
- Respects
.gitignore automatically
- Smart case-insensitive search
- Simpler syntax than
find
- Regular expression support
Basic Usage
Simple File Search
fd config
fd -e rs
fd -e md
fd -e js -e ts
fd -s Config
Pattern Matching
fd '^test_.*\.py$'
fd '\.config$'
fd '^[A-Z]'
fd '*.lua'
fd 'test-*.js'
Advanced Filtering
Type Filtering
fd -t f pattern
fd -t d pattern
fd -t l pattern
fd -t x pattern
fd -t f -t l pattern
Depth Control
fd -d 1 pattern
fd -d 3 pattern
fd --max-depth 2 pattern
fd --min-depth 2 pattern
Hidden and Ignored Files
fd -H pattern
fd -I pattern
fd -u pattern
fd -H -I pattern
Size Filtering
fd --size +10m
fd --size -1k
fd --size +100k --size -10m
Modification Time
fd --changed-within 1d
fd --changed-within 2w
fd --changed-within 3m
fd --changed-before 1y
Execution and Processing
Execute Commands
fd -e jpg -x convert {} {.}.png
fd -e rs -x rustfmt
fd -e md -X wc -l
Output Formatting
fd -e tf --format '{//}'
fd -e rs --format '{/}'
fd -e md --format '{.}'
Integration with Other Tools
fd -e log -x rm
fd -e rs -X wc -l
fd -e py -x rg "import numpy" {}
fd -e md -X nvim
cat filelist.txt | xargs rg "TODO"
Common Patterns
Development Workflows
fd -e test.js -e spec.js
fd '^test_.*\.py$'
fd '_test\.go$'
fd -g '*.config.js'
fd -g '.env*'
fd -g '*rc' -H
fd -e rs -e toml -t f
fd -e py --exclude __pycache__
fd -e ts -e tsx src/
Cleanup Operations
fd -e pyc -x rm
fd node_modules -t d -x rm -rf
fd -g '*.log' --changed-before 30d -X rm
fd --size +100m -t f
fd --size +1g -t f -x du -h
Path-Based Search
fd pattern src/
fd pattern src/ tests/
fd -e rs -E target/
fd -e js -E node_modules -E dist
fd -p src/components/.*\.tsx$
Find Directories Containing Specific Files
fd -t f 'main\.tf$' --format '{//}'
fd -t f '^package\.json$' --format '{//}'
fd -t f '^go\.mod$' --format '{//}'
fd -t f '^pyproject\.toml$' --format '{//}'
fd -t f '^Cargo\.toml$' --format '{//}'
Note: Use --format '{//}' instead of piping to xargs - it's faster and simpler.
Best Practices
When to Use fd
- Finding files by name or pattern
- Searching with gitignore awareness
- Fast directory traversal
- Type-specific searches
- Time-based file queries
When to Use find Instead
- Complex boolean logic
- POSIX compatibility required
- Advanced permission checks
- Non-standard file attributes
Performance Tips
- Use
-j 1 for sequential search if order matters
- Combine with
--max-depth to limit scope
- Use
-t f to skip directory processing
- Leverage gitignore for faster searches in repos
Integration with rg
fd -e py -x rg "class.*Test" {}
fd -e rs -x rg "TODO" {}
fd -e md -x rg "# " {}
Use fd's Built-in Execution
fd -t f 'main\.tf$' --format '{//}'
fd -e log -x rm
Quick Reference
Essential Options
| Option | Purpose | Example |
|---|
-e EXT | Filter by extension | fd -e rs |
-t TYPE | Filter by type (f/d/l/x) | fd -t d |
-d DEPTH | Max search depth | fd -d 3 |
-H | Include hidden files | fd -H .env |
-I | Include ignored files | fd -I build |
-u | Unrestricted (no ignore) | fd -u pattern |
-E PATH | Exclude path | fd -E node_modules |
-x CMD | Execute command | fd -e log -x rm |
-X CMD | Batch execute | fd -e md -X cat |
-s | Case-sensitive | fd -s Config |
-g GLOB | Glob pattern | fd -g '*.json' |
--format FMT | Custom output format | fd -e tf --format '{//}' |
Time Units
s = seconds
m = minutes
h = hours
d = days
w = weeks
y = years
Size Units
b = bytes
k = kilobytes
m = megabytes
g = gigabytes
t = terabytes
Common Command Patterns
fd -e rs --changed-within 1d
fd -d 1 -t f --size +10m
fd -t x -e sh
fd -H -g '*config*'
fd -e py -X wc -l
fd -e js -E dist -E node_modules -E build
fd -t f 'main\.tf$' --format '{//}'
fd -t f '^package\.json$' --format '{//}'
This makes fd the preferred tool for fast, intuitive file finding in development workflows.