The traditional GNU find command has served as the backbone of Unix file search operations for decades, yet its syntax is notoriously verbose and its execution single-threaded. For modern system administrators and developers, fd (also distributed as fdfind) offers an intuitive, blisteringly fast alternative written in Rust. Operating with sensible defaults—such as parallel directory traversal, automated colourised output, case-insensitivity by default, and automatic exclusion of hidden files and .gitignore patterns—fd substantially accelerates terminal workflows.
Installing fd Across Linux Distributions
Due to a naming conflict on Debian-based systems with another utility, the binary is frequently packaged under the name fdfind. Install it using your distribution’s native package manager:
- Ubuntu and Debian:
sudo apt update && sudo apt install fd-findTo use the standard
fdcommand name rather thanfdfind, create an alias or symlink in your local bin directory:ln -s $(which fdfind) ~/.local/bin/fd - Fedora, RHEL, and CentOS:
sudo dnf install fd-find - Arch Linux and Manjaro:
sudo pacman -S fd - Alpine Linux:
sudo apk add fd
Basic Search Syntax and Smart Case Matching
Unlike find, which requires explicit flags like -name and quotes around wildcards, fd accepts search patterns directly as simple regex or string inputs:
- Simple Search: To locate any file or folder containing “config” anywhere in the current directory tree:
fd config - Smart Case Sensitivity: If your query contains only lowercase letters (
fd report),fdperforms a case-insensitive search. If you include an uppercase letter (fd Report), it automatically switches to case-sensitive matching. - Explicit Case Control: Override smart matching using
-s(case-sensitive) or-i(case-insensitive):fd -s Report
Filtering by File Type and Extension
Restricting search queries to specific data types is concise and readable using standard command flags:
- Filter by Extension: Use the
-eflag to search for specific file suffixes without writing glob expressions:fd -e pyTo combine a search pattern with an extension filter:
fd user_auth -e ts - Filter by File Type: Use the
-tflag followed byf(file),d(directory),l(symlink),x(executable), ore(empty):fd -t d backup # Search only for directories named backup fd -t x deploy # Search only for executable scripts named deploy fd -t e # Locate all empty files and folders
Searching Hidden Files and Git Repositories
By default, fd automatically respects your .gitignore rules and skips hidden files (dotfiles) to preserve speed and avoid clutter. When auditing system configurations, you can easily disable these restrictions:
- Include Hidden Files: Add the
-H(or--hidden) flag:fd -H zshrc - Ignore .gitignore Restrictions: Add the
-I(or--no-ignore) flag to search vendor directories or build artefacts:fd -I bundle.js - Unrestricted Search: Combine both flags using
-u(or-uuto search ignored, hidden, and binary paths):fd -u secret_key /etc
Executing Commands on Search Results
One of fd‘s most powerful capabilities is seamless command execution without the awkward syntax of find -exec ... \;:
- Parallel Command Execution: Use the
-x(or--exec) flag to run a command against each matching result concurrently:fd -e log -x gzip {}Here,
{}represents the placeholder for each matched file path, whichfdcompresses using multi-threaded execution. - Batch Command Execution: Use
-X(capital X) to pass all discovered paths simultaneously to a single command invocation, ideal for tools likechmod,chown, or text editors:fd -e md -X wc -l
Adopting fd streamlines daily terminal operations, combining the performance benefits of Rust-powered multithreading with an interface that prioritises clarity and developer productivity.