fd(1)
A fast alternative to find that searches for files and directories with simpler syntax and colorized output.
Synopsis
fd [OPTIONS] [PATTERN] [PATH]Description
fd is a user-friendly replacement for the traditional find command. It uses parallel searching, respects .gitignore files by default, and provides intuitive glob patterns without complex flag syntax.
By default, fd searches recursively from the current directory, skips hidden files and directories, and excludes paths listed in .gitignore. It colorizes output and supports regex patterns, making file searching faster and more discoverable than find.
Common options
| Flag | What it does |
|---|---|
-i, --case-insensitive | Case-insensitive search |
-e, --extension <ext> | Filter by file extension (e.g., -e txt) |
-t, --type <type> | Filter by type: f (file), d (directory), l (symlink), x (executable), s (socket), p (pipe) |
-H, --hidden | Include hidden files and directories |
-I, --no-ignore | Do not respect .gitignore files |
-x, --exec <cmd> | Execute command for each search result; use {} as placeholder |
-0, --print0 | Print null-separated output (useful with xargs -0) |
-l, --list | List each result once per line (default output format) |
-d, --max-depth <depth> | Limit search recursion depth |
-a, --absolute-path | Show absolute paths instead of relative |
Examples
Search for files/directories matching pattern recursively from current directory
fd patternFind all .txt files in current directory and subdirectories
fd -e txtFind all directories named 'config' (case-sensitive)
fd -t d configCase-insensitive search for files containing 'readme'
fd -i -t f readmeInclude hidden files; find files containing '.bash' (shows .bashrc, .bash_history, etc.)
fd -H .bashFind files named 'src' up to 2 levels deep
fd -d 2 -t f srcFind all .rs files and count lines in each using wc
fd '\.rs$' -x wc -lSearch in a specific directory, non-recursive (depth 1)
fd pattern /path/to/search --max-depth 1