fd, a Rust-powered "find"

If find is the Swiss Army knife of file search—reliable, battle-tested, and a tiny bit prickly—fd is the sleek multitool that snaps open with a satisfying click. Same job, different vibe. Faster. Friendlier. And opinionated in all the right places.

Below, we unpack what makes fd such a compelling drop-in for your daily grep-n-go workflows—and where it deliberately diverges from the old ways.


What is fd?

fd (often packaged as fd-find on some distros) is a modern, fast, and user-centric alternative to find. Written in Rust, it leans on safe concurrency and efficient I/O to rip through directories with a light touch and a small footprint. Think “zero-to-results” with fewer flags and saner defaults.


Why people switch: the defaults are the feature

  • Ignores noise by default. fd respects .gitignore, .ignore, and global ignore files out of the box. Your search skips node_modules/, build folders, and other lint you didn’t mean to trawl.

  • Humane output. Clean, colorized paths. Unicode-aware. It reads nicely on dark or light terminals and plays well in pipes.

  • Predictable matching. Smart case by default: lowercase patterns do case-insensitive matches; add capitals and it flips to case-sensitive.

  • Parallel and speedy. Multi-threaded directory walking means big trees don’t feel big. You notice it instantly on monorepos.

  • Regex first, glob if you ask. Patterns are regular expressions by default; switch to glob mode when that’s a better mental model.

The effect? You type less, you get what you meant, and you move on.


Syntax you’ll actually remember

find is encyclopedic; fd is conversational. A few patterns you’ll use daily:

  • Search by name (regex by default):

    fd login
    

    Finds files and directories whose names match login—skipping ignored paths.

  • Only files, only dirs, only symlinks:

    fd -t f report     # files
    fd -t d config     # directories
    fd -t l readme     # symlinks
    
  • By extension (no fragile -name '*.ext' dance):

    fd -e md README
    fd -e jpg -e png logo
    
  • Hidden files and ignored paths (explicit opt-in):

    fd -H --no-ignore '^\.env'
    
  • Switch to glob mode when it clicks better:

    fd -g '**/*.ts'
    
  • Run commands on the results (safe and batch-friendly):

    fd -e jpg -x mogrify -strip -interlace Plane -quality 82 {}
    fd -t d -x sh -c 'cd "$1" && git status -s' sh {}
    fd -e log -X tar -rf logs.tar  # batch variant
    
  • Filter by depth without mental gymnastics:

    fd -d 1            # only current dir
    fd -d 3 src        # within three levels
    
  • Content plus name, with rip-through speed (pair with ripgrep):

    rg -n 'TODO' $(fd -t f -e rs -e ts)
    

fd vs. find: the quick mental model

  • Defaults: fd excludes hidden and ignored paths until you say otherwise; find shows everything unless you filter.

  • Matching: fd uses regex by default; find leans on predicates (-name, -regex, -path, etc.).

  • Ergonomics: fd centralizes common filters (-t, -e, -H, --no-ignore) and makes execution flags (-x, -X) obvious.

  • Speed: fd tends to be faster in real-world repos thanks to parallelism and smart skipping.

  • Completeness: find still wins for baroque, POSIX-portable incantations and esoteric predicates. You won’t uninstall it.

Bottom line: 90% of daily searches feel better with fd. The last 10% is why find lives on.


Everyday workflows that get nicer

  • “Show me likely config folders”:

    fd -t d 'config|configs|configuration' -d 4
    
  • “List TypeScript test files, quickly”:

    fd -e ts -g '**/*.{spec,test}.ts'
    
  • “Purge generated images (dry-run first)”

    fd -e png -e jpg '^out-' -t f
    fd -e png -e jpg '^out-' -t f -x rm -v {}
    
  • “Archive logs modified this week”

    fd -e log -x sh -c 'printf "%s\0" "$@" | tar --null -T - -rvf week-logs.tar' sh {}
    
  • “Find dangling symlinks”

    fd -t l -x sh -c '[ -e "$1" ] || echo "$1"' sh {}
    

Installation notes (and the Debian/Ubuntu quirk)

  • macOS (Homebrew): brew install fd

  • Arch: pacman -S fd

  • Fedora: dnf install fd-find

  • Debian/Ubuntu: package name is fd-find. If you want the fd command, add a friendly alias:

    echo "alias fd=fdfind" >> ~/.bashrc
    

That naming detour exists to avoid clashing with an older, unrelated fdclone utility.


Performance and caveats

  • It feels fast because it skips what you don’t want. Respecting ignore files and running in parallel cuts noise and time.

  • You’ll still reach for find for exotic POSIX one-liners, in-place -exec … + edge cases, or ancient servers where installing new tooling is a no-go.

  • Regex vs glob: Remember that fd assumes regex; flip on -g when wildcards match your brain.


The practical verdict

fd doesn’t try to out-lawyer find. It just makes the common path smooth: better defaults, clearer flags, and real speed on messy trees. If you live in a repo, juggle languages, or wrangle logs, fd becomes muscle memory fast.

Install it. Alias it if needed. And let your fingers forget half the flags you used to Google.


Quick reference (bookmark-worthy)

  • fd PATTERN — search names (regex)

  • fd -t f|d|l — filter by file/dir/symlink

  • fd -e EXT — filter by extension (repeatable)

  • fd -H — include hidden files

  • fd --no-ignore — ignore the ignores

  • fd -g GLOB — use glob syntax

  • fd -d N — limit search depth

  • fd -x CMD {} — run a command per match

  • fd -X CMD — batch matches into one command

Once you’ve felt the glide, going back to clunky search feels… prehistoric.

Comments