fd
A faster, simpler replacement for find
1. What is fd?
fd is a command-line tool for finding files and directories.
Think of it as:
find, but human-friendly
fd is designed with sane defaults, clear syntax, and excellent performance.
2. Why use fd?
Compared to find, fd:
- ⚡ Is much faster
- ✨ Has simple syntax
- 🧠 Uses smart defaults
- 🚫 Respects
.gitignore - 🎨 Has colored output
- 🦀 Written in Rust
3. Installing fd
macOS (Homebrew)
On macOS, the binary is usually named
fd.
Linux
On some distros, use:
Then create an alias:
4. Basic usage
4.1 Find files by name
Finds all files and directories with main in the name.
4.2 Find only files
Find only directories
4.3 Search in a specific directory
5. Pattern matching (very important)
By default, fd uses regular expressions.
Simple substring match
Matches:
Exact match
File extension
6. Case sensitivity
- Case-sensitive by default
Case-insensitive search
7. Ignore rules
By default, fd ignores:
.gitignore.ignore.fdignore- Hidden files
Include hidden files
Ignore .gitignore
8. Excluding paths
Exclude a directory
Exclude multiple paths
9. Run commands on results (-x)
One of the most powerful features.
Example: delete matched files
Format:
Example: open files in editor
10. Combine fd with rg
Find files first, then search inside them:
11. Limit search depth
Search only current directory
12. Show full paths
13. fd vs find (quick comparison)
| Feature | fd | find |
|---|---|---|
| Simple syntax | ✅ | ❌ |
| Fast | ⚡ | 🐢 |
.gitignore aware |
✅ | ❌ |
| Colored output | ✅ | ❌ |
14. Common beginner mistakes
❌ Using *
✅ Correct
❌ Expecting glob behavior
Remember: regex, not glob.
15. Typical workflow examples
16. Summary
fd gives you:
- Faster file searches
- Cleaner syntax
- Safer defaults
- Less typing
Once you try it, going back to find feels painful.
17. Recommended tool combo
| Task | Tool |
|---|---|
| Jump directories | zoxide |
| Find files | fd |
| Search content | ripgrep |
| Interactive filter | fzf |
A modern terminal stack 🚀