Tools

fd: a simpler, faster alternative to find

TL;DR

fd finds files with short syntax and skips hidden and .gitignored files by default. -e filters extensions, -t types, -H -I includes everything, -x runs per file in parallel, -X batches into one command.

find is powerful but its syntax is hard to remember: find . -type f -name "*.py" -not -path "*/node_modules/*" just to list Python files. fd is a simpler, faster alternative: short syntax, hidden and .gitignored files skipped by default, coloured output, and parallel command execution on each result. It doesn't do everything find does, but it covers 90% of everyday cases neatly.

GitHub page of sharkdp/fd
GitHub page of sharkdp/fd (screenshot, November 2026)

GitHub: https://github.com/sharkdp/fd · about 45k stars · Rust · Apache-2.0/MIT

Installation

brew install fd                  # macOS
sudo apt install fd-find         # Ubuntu/Debian: the command is fdfind
cargo install fd-find            # with Rust

# On Ubuntu
ln -s $(which fdfind) ~/.local/bin/fd

Quick comparison with find

Taskfindfd
Files with "config" in the namefind . -iname '*config*'fd config
All .py filesfind . -name '*.py'fd -e py
Directories onlyfind . -type d -name 'test*'fd -t d '^test'
Include hidden and ignored files(default)fd -H -I pattern
Modified in the last 2 daysfind . -mtime -2fd --changed-within 2d

fd patterns are regular expressions by default and use smart case: lowercase is case-insensitive, any capital makes it case-sensitive. For shell-style globs add -g: fd -g '*.test.ts'.

Running commands on results

# -x: run in parallel for each file
fd -e jpg -x convert {} {.}.png

# -X: pass all results to ONE command
fd -e ts -X prettier --write

# Delete nested node_modules folders (needs -I because they're ignored)
fd -I -t d '^node_modules$' -X rm -rf
PlaceholderMeaningExample for src/img/a.jpg
{}Full pathsrc/img/a.jpg
{.}Without extensionsrc/img/a
{/}File name onlya.jpg
{//}Parent directorysrc/img

Caveats

  • Can't find a file you know exists? It may be gitignored or hidden; add -H -I.
  • Be careful with rm: run fd without -x/-X first to see what would be deleted.
  • Exclude specific directories with -E, e.g. fd -e log -E vendor.

How to apply it

  • Dev: Use fd as fzf's source (FZF_DEFAULT_COMMAND='fd --type f') for an IDE-style "Go to file" in the terminal.
  • Tech Lead: Write cleanup and bulk-conversion scripts (images, code formatting) with -x/-X instead of shell loops that break on file names with spaces.
  • PM: For quick counts (how many test files, config files), fd -e test.ts | wc -l gives an answer immediately.

Sources & references

  1. sharkdp/fd — sharkdp (GitHub)