fd
Overview
fd is a simple, fast, and user-friendly alternative to find. It features colorized output, sensible defaults (ignoring hidden files and .gitignore patterns by default), parallel directory traversal, and intuitive regex search patterns.
Syntax
fd [options] [pattern] [path...]Common Options
| Option | Description |
|---|---|
-e, --extension EXT |
Filter results by file extension |
-t, --type TYPE |
Filter by type: f (file), d (directory), l (symlink), x (executable) |
-H, --hidden |
Include hidden files and directories in search |
-I, --no-ignore |
Do not respect .gitignore rules |
-x, --exec CMD |
Execute a command for each search result |
-X, --exec-batch CMD |
Execute a command with all search results passed as arguments |
Key Use Cases
- Finding files by extension or pattern quickly without complex
findsyntax. - Running operations on matching files using
-xor-X. - Quick discovery of nested project subdirectories.
Examples with Explanations
Example 1: Finding Files by Extension
fd -e mdFinds all Markdown (.md) files under the current directory.
Example 2: Regex Name Matching
fd "config.*\.yml$"Searches for files matching the regular expression config.*\.yml$.
Example 3: Executing Commands on Found Files
fd -e log -x rmFinds all .log files and deletes them using rm.