fd Guide
brew install fd sudo apt install fd-find cargo install fd-find # Windows: scoop install fd npm install -g fd-find
fd is 3-5x faster than find, respects .gitignore by default, and uses colorized output. The regex-based pattern matching is more intuitive than find's -name syntax. Common: `fd pattern` (search name), `fd -e py` (find .py files), `fd -t d src` (find directories).
fd integrates with fzf: `vim $(fd -tf | fzf)`. Use -x for per-file execution, -X for batch (all files as args). Add -H to include hidden files, -I to ignore .gitignore, -d to limit depth.
For content search, pair with ripgrep: `fd -e py -x rg "TODO" {}`. Use --exec-batch for bulk operations on all results at once.
Search
fd "main" fd "config.*json" fd "^test_" fd "\.tsx$" fd -e tsx
Filtering
fd -e py fd -e js -e ts fd -e md --no-ignore fd -e txt -d 2
fd -t f pattern fd -t d pattern fd -t l pattern fd -t x pattern fd -t f -e py "test"
fd -H pattern fd -I pattern fd --no-ignore -e node_modules fd -H -t d ".config"
Execution
fd -e py -x python {}
fd -e txt -x wc -l {}
fd -e md -X npx prettier --write
fd -e jpg -X tar czf images.tar.gz
fd -e log -X rm {}# {} = full path
# {.} = no extension
# {/} = basename
# {//} = parent dir
# {/.} = basename no extension
fd -e py -x echo {.}
fd -e jpg -x mv {} {//}/backup/{/}Integration
vim $(fd -t f | fzf) cd $(fd -t d | fzf) # Edit all Python files in project: fd -e py -X nvim