fd is a fast, user-friendly alternative to the classic Unix find command, written in Rust. It simplifies searching files and directories with intuitive syntax while delivering speed gains through parallelized directory traversal. What sets fd apart is its ability to execute commands in parallel on found files using a placeholder syntax inspired by GNU Parallel — turning a simple file finder into a powerful batch-processing tool.
What fd does and how it is built
At its core, fd searches for filesystem entries matching a pattern, much like find, but with a more convenient and less verbose interface. Instead of the traditional find syntax, you just run fd PATTERN. For example, searching for files containing “netfl” in their name is as simple as:
fd netfl
Under the hood, fd is implemented in Rust, a language known for safety and performance. It leverages parallel traversal of directories to increase speed significantly compared to the single-threaded find command. The command name itself is shorter, making it quicker to type.
fd respects common developer conventions by default: it skips hidden files, respects .gitignore files, uses smart case-insensitive matching, and colorizes output similarly to ls. It supports both regex and glob pattern matching, giving flexibility in search criteria.
Why fd’s parallel command execution distinguishes it
One of fd’s standout features is its ability to execute commands on search results in parallel, specified with -x or --exec. Unlike find’s -exec, fd supports GNU Parallel-style placeholders like {}, {.}, {/}, {//}, and {/.} to represent various parts of the matched file path. This design turns fd into a composable tool that can find and process files in one step without juggling xargs or complicated loops.
This parallel execution model is a tradeoff between ease of use and shell compatibility: while it covers many common use cases elegantly, extremely complex command pipelines may still require traditional tools. The codebase is notably clean and pragmatic, focusing on developer experience without sacrificing performance.
Rust’s safety guarantees and concurrency primitives make the parallel traversal and command execution robust and efficient. This reduces the risk of race conditions or common bugs found in shell scripts handling large file sets.
Quick start
The fd README provides several usage examples to get started quickly:
Simple search
Run fd with a search pattern to find entries containing that pattern recursively from the current directory:
> fd netfl
Software/python/imdb-ratings/netflix-details.py
Regular expression search
Patterns are treated as regular expressions. For example, find entries starting with “x” and ending with “rc”:
> cd /etc
> fd '^x.*rc$'
X11/xinit/xinitrc
X11/xinit/xserverrc
Specifying the root directory
You can provide a directory as a second argument to search within it:
> fd passwd /etc
/etc/default/passwd
/etc/pam.d/passwd
/etc/passwd
List all files recursively
Calling fd with no arguments lists all entries recursively, similar to ls -R:
> cd fd/tests
> fd
testenv
testenv/mod.rs
tests.rs
To list all files in a specific directory, use a catch-all pattern like .:
> fd . fd/tests/
testenv
testenv/mod.rs
tests.rs
Search by file extension
Use the -e or --extension option to find files by extension, e.g., Markdown files:
> cd fd
> fd -e md
CONTRIBUTING.md
README.md
Combine extension filtering with a search pattern:
> fd -e rs mod
src/fshe
Verdict
fd is a practical, performance-conscious replacement for find that targets real-world developer workflows. Its defaults make it friendlier out of the box, respecting .gitignore and hidden files, while the parallel directory traversal speeds up searches on large trees.
The parallel command execution feature is particularly valuable for batch-processing files without the usual shell gymnastics, streamlining complex pipelines.
However, fd does not replicate every find feature — if you need very specialized predicates or extremely complex actions, traditional find or GNU Parallel might still be necessary.
For developers who want a faster, clearer, and more modern file finder that integrates well into shell pipelines, fd is worth adopting. Its Rust implementation provides a robust foundation, and the code quality reflects pragmatic choices prioritizing speed and usability over exhaustive feature bloat.
Related Articles
- FSearch: a lightweight C-based instant file search tool for Linux desktops — FSearch delivers instant file search on Linux using a pre-built indexed database. Written in C with GTK3, it balances pe
- Inside fzf: how a Go fuzzy finder processes millions of items instantly — fzf is a fast, portable command-line fuzzy finder in Go that processes millions of items instantly. This article explore
- nh: a Rust-based unified CLI for the Nix ecosystem with enhanced search and ergonomics — nh is a Rust CLI tool consolidating Nix, NixOS, and Home Manager commands with improved ergonomics, speed, and Elasticse
- dirsearch: a Python web path brute-forcer with precise extension handling — dirsearch is a Python tool for brute-forcing web paths with a clever extension handling system. It offers multi-threaded
- Czkawka: a Rust core library powering multi-frontend file cleanup tools — Czkawka uses a safe Rust core library to power multiple cross-platform frontends and CLI for file cleanup, with caching,
→ GitHub Repo: sharkdp/fd ⭐ 42,844 · Rust