| name | fd-find |
| description | A fast and user-friendly alternative to 'find' - simple syntax, smart defaults, respects gitignore. |
| homepage | https://github.com/sharkdp/fd |
fd - Fast File Finder
User-friendly alternative to find with smart defaults.
Quick Start
Basic search
fd pattern
fd pattern /path/to/dir
fd -i pattern
Common patterns
fd -e py
fd -e py -e js -e ts
fd -t d pattern
fd -t f pattern
fd -t l
Advanced Usage
Filtering
fd pattern -E "node_modules" -E "*.min.js"
fd -H pattern
fd -I pattern
fd -H -I pattern
fd pattern -d 3
Execution
fd -e jpg -x convert {} {.}.png
fd -e md -x wc -l
fd -e log -0 | xargs -0 rm
Regex patterns
fd '^test.*\.js$'
fd --full-path 'src/.*/test'
fd -g "*.{js,ts}"
Time-based filtering
fd --changed-within 1d
fd --changed-before 2024-01-01
fd --changed-within 1h
Size filtering
fd --size +10m
fd --size -1k
fd --size +100k --size -10m
Output formatting
fd --absolute-path
fd --list-details
fd -0 pattern
fd --color always pattern
Common Use Cases
Find and delete old files:
fd --changed-before 30d -t f -x rm {}
Find large files:
fd --size +100m --list-details
Copy all PDFs to directory:
fd -e pdf -x cp {} /target/dir/
Count lines in all Python files:
fd -e py -x wc -l | awk '{sum+=$1} END {print sum}'
Find broken symlinks:
fd -t l -x test -e {} \; -print
Search in specific time window:
fd --changed-within 2d --changed-before 1d
Integration with other tools
With ripgrep:
fd -e js | xargs rg "pattern"
With fzf (fuzzy finder):
vim $(fd -t f | fzf)
With bat (cat alternative):
fd -e md | xargs bat
Performance Tips
fd is typically much faster than find
- Respects
.gitignore by default (disable with -I)
- Uses parallel traversal automatically
- Smart case: lowercase = case-insensitive, any uppercase = case-sensitive
Tips
- Use
-t for type filtering (f=file, d=directory, l=symlink, x=executable)
-e for extension is simpler than -g "*.ext"
{} in -x commands represents the found path
{.} strips the extension
{/} gets basename, {//} gets directory
Documentation
GitHub: https://github.com/sharkdp/fd
Man page: man fd