fd
Overview
fd is a fast, user-friendly alternative to find. Defaults are developer-friendly: colorized output, sensible ignore of hidden files and .gitignore entries, parallel traversal, and simple regex patterns. Keep find for full POSIX power and exotic predicates; use fd for everyday “find me files named …” work.
sudo apt install fd-find # Debian/Ubuntu binary often named fdfind
# symlink tip on Debian:
# mkdir -p ~/.local/bin && ln -s $(command -v fdfind) ~/.local/bin/fd
sudo dnf install fd-findSyntax
fd [options] [pattern] [path...]Common Options
| Option | Description |
|---|---|
-e EXT |
Extension filter (repeatable) |
-t f/d/l/x/e |
Type: file, dir, symlink, executable, empty |
-H |
Include hidden |
-I |
Don’t respect ignore files |
-u / -uu |
Unrestricted (like rg’s -u) |
-x cmd |
Exec per result ({} placeholder) |
-X cmd |
Batch exec with all results |
-d N |
Max depth |
-g glob |
Glob mode instead of regex |
-s |
Case sensitive (default may be smart case) |
-p |
Match full path |
-a |
Absolute paths |
-0 |
NUL-delimited |
-S size |
Size filter (+1m, -100k) |
--changed-within |
Time filters (version-dependent) |
Key Use Cases
- Find files by name/extension quickly
- Run a command on each match (
-x) - Search including gitignored build dirs (
-I/-u) - Generate file lists for pipelines (
-0+xargs -0)
Examples with Explanations
By extension and pattern
fd -e md
fd -e go -e rs
fd 'config.*\.ya?ml$'
fd -g '*.toml'Exec
fd -e log -x rm
fd -e jpg -x convert {} {.}_thumb.jpg # if ImageMagick present
fd -e md -X wc -l-x runs once per file; -X batches arguments.
Ignore rules
fd pattern # respects .gitignore
fd -I pattern # include ignored
fd -u secret # more unrestrictedOne-liner recipes
# Recent-ish markdown under repo (if --changed-within available)
fd -e md --changed-within 7d
# Safe delete of __pycache__
fd -t d -g __pycache__ -x rm -rf
# Feed ripgrep
fd -e py -0 | xargs -0 rg 'TODO'Notes & Pitfalls
- On Debian/Ubuntu the binary is often
fdfindto avoid clashing withfdclone. - Regex is not shell glob by default—use
-gfor globs. -x rmwithout care deletes widely; preview with plainfdfirst.- Color can break scripts—use
fd --color neveror redirect.
2026-relevant notes
fd+rgis the modern find/grep pair for source trees;find+grepremain the portable baseline.- Large monorepos: prefer
fd’s parallelism; for network filesystems test both tools. - Combine with
fzffor interactive picking:fd -t f | fzf.
Comparison to alternatives
| Tool | Notes |
|---|---|
fd |
Fast UX defaults |
find |
Full predicates, portable |
locate/plocate |
DB-backed name search |
rg --files |
List files rg would search |
Additional Resources
- Upstream
fdREADME man fd/man fdfind