What fd Does
- Regex matching — default,
--globfor glob patterns - Gitignore aware — respects .gitignore by default
- Colored output — file type colors via LS_COLORS
- Parallel traversal — multi-threaded walking
- Exec commands —
-xor-Xto run commands on matches - Smart case — case-insensitive when pattern is all lowercase
- File type filter —
-t ffile,-t ddir,-t llink - Time filters — changed-within, changed-before
- Size filters —
--size +1M
Architecture
Single Rust binary using walkdir + ignore crates for traversal. Runs on multiple threads (one per CPU). Uses Rust regex engine for pattern matching.
Self-Hosting
CLI tool.
Key Features
- ~5x faster than find on average
- Smart defaults (gitignore, smart case, colors)
- Simple intuitive syntax
- Parallel traversal
- Integration with xargs via
-x/-X - Unicode aware
- Size and time filters
Comparison
| Tool | Language | Smart Defaults | Syntax |
|---|---|---|---|
| fd | Rust | Yes | Intuitive |
| find | C | None | POSIX verbose |
| fdupes | C | Dup focus | Specialized |
| ripgrep + --files | Rust | Yes | Different focus |
FAQ
Q: Why is it called fdfind on Ubuntu?
A: Yes, due to a naming conflict. Just alias it: alias fd=fdfind.
Q: How much faster than find? A: Typically 3-10x. The gap widens on large repos because fd runs in parallel and skips .gitignore entries.
Q: How to delete all matches?
A: fd -t f pattern -x rm. Add -0 | xargs -0 rm for extra safety (correctly handles spaces and newlines).
Sources
- GitHub: https://github.com/sharkdp/fd
- License: Apache 2.0 / MIT