How to install fd for fast find: gitignore rules, common flags, vs find

Install fd, understand ignore rules, skim common flags, and keep find for mtime and POSIX scripts.

find can locate anything, but daily filename searches in a repo mean long flags and trips through node_modules. fd (Rust, by sharkdp) defaults to recursive search with ignore rules applied. This guide covers installing fd on macOS/Linux, ignore files (.gitignore, .fdignore), common flags, and fd vs find for hereink readers who already use ripgrep in the same terminal stack.

The query is how to install fd fast find with gitignore rules and compare to find. You should finish with fd on PATH, a first search from the repo root, a clear picture of what gets skipped by default, and when to keep find for mtime or POSIX scripts.

installbrew · apt · dnf
ignore.gitignore · .fdignore
comparefd vs find
install fdignore rulescommon flags

What fd fixes

Shorter than find for names

find . -iname '*config*' needs path, tests, and quoting. fd config recurses from the current directory, matches path substrings or patterns (see -g), prints one path per line—ready for rg, bat, or -x.

Same ignore story as ripgrep

rg searches content; fd lists paths. Both respect .gitignore in Git trees so dist and dependency folders stay out of casual listings. Our bat guide covers highlighted reading; this article stays on fd alone.

Upstream: github.com/sharkdp/fd. Run fd --version after install.

Install on macOS and Linux

  1. 1
    macOS (Homebrew)

    brew install fd. Verify with which fd and fd --version.

  2. 2
    Debian / Ubuntu

    sudo apt update && sudo apt install fd-find. The binary is often fdfind; add alias fd=fdfind or use your distro’s compatibility package for the fd name.

  3. 3
    Fedora / Arch

    Fedora: sudo dnf install fd. Arch: sudo pacman -S fd. Grab release binaries from GitHub if repos lag.

  4. 4
    Optional: Rust

    cargo install fd-find when you already ship a Rust toolchain.

Ignore rules: what fd skips

Inside a Git repo, fd applies ignore rules by default, similar to ripgrep:

  • .gitignore in the tree; ignored paths usually stay hidden even if untracked.
  • .ignore and global ignore files (see fd --help and the README ignore section).
  • .fdignore for fd-only excludes without editing the team .gitignore.
  • The .git directory is not treated like a normal search target for everyday file finds.
fd Cargo.toml
fd --no-ignore vendor
fd -I secret
fd -H .env
fd --max-depth 1 Makefile

Common flags

fd -e rs
fd -t f README
fd -t d src
fd -i dockerfile
fd -g '*.min.js'
fd -E node_modules -E '*.pyc' test
fd -e md -x wc -l {}
fd '\.toml$' ./crates

Add -L to follow symlinks. Full list: fd --help.

fd vs find

Goalfdfind
Name fragmentfd configfind . -iname '*config*'
Extensionfd -e gofind . -name '*.go'
.gitignoreon by defaultmanual -prune or git ls-files
mtime / permissionsuse findfind . -mtime -7, -perm
Exec per hitfd … -x rm {} (dry-run first)find … -exec rm {} +
Max depth--max-depth N-maxdepth N
Portabilitymodern Unix/macOS; see Windows docsPOSIX everywhere

Pair with ripgrep: fd -e py | xargs rg 'def main'; prefer fd … -x rg pattern {} when paths may contain spaces.

Fits
Daily filename/extension lists in repos, scoping scripts, living beside rg and bat.
Does not fit
Disk cleanup by mtime, heavy boolean find expressions, or minimal POSIX-only containers—keep find.
Ubuntu ships fdfind only?

Package fd-find installs fdfind. Alias fd=fdfind in your shell rc or use a compat package.

Overlap with the fd+bat article?

That guide adds bat and pipe recipes; this one goes deeper on ignore rules and find comparison. Read both if you want the full stack.

Regex or substring?

Default matching behaves like a path substring unless you opt into other modes; use -g for globs. When unsure, run a plain fd fragment first, then check fd --help SEARCH.

After you scope modules, align on one board

Once paths point at services or crates, boundaries still belong on a shared canvas. See how to create a space.

Start a room