Linux command
fd 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Find files by
fd [pattern]
Find with specific
fd -e [txt] [pattern]
Find in directory
fd [pattern] [directory]
Include hidden files
fd -H [pattern]
Execute command on
fd [pattern] -x [command]
说明
fd is a modern replacement for find, written in Rust. It provides intuitive syntax, colorful output, smart defaults, and significant performance improvements over traditional find. By default, fd ignores hidden files and respects .gitignore patterns. It uses regex patterns rather than glob, provides parallel command execution, and produces human-friendly output. fd aims to cover 80% of find use cases with simpler syntax while being faster through parallelization.
参数
- -e _EXT_, --extension _EXT_
- Filter by file extension.
- -t _TYPE_, --type _TYPE_
- Filter by type: f (file), d (directory), l (symlink).
- -H, --hidden
- Include hidden files.
- -I, --no-ignore
- Don't respect .gitignore.
- -x _CMD_, --exec _CMD_
- Execute command on each result.
- -X _CMD_, --exec-batch _CMD_
- Execute command with all results.
- -d _N_, --max-depth _N_
- Maximum search depth.
- -g, --glob
- Use glob pattern instead of regex.
- -E _PATTERN_, --exclude _PATTERN_
- Exclude entries matching pattern.
- -S _SIZE_, --size _SIZE_
- Filter by size (e.g., +1m, -100k).
- --changed-within _DATE_
- Filter by modification time.
- -c, --color _WHEN_
- When to use colors (auto, always, never).
FAQ
What is the fd command used for?
fd is a modern replacement for find, written in Rust. It provides intuitive syntax, colorful output, smart defaults, and significant performance improvements over traditional find. By default, fd ignores hidden files and respects .gitignore patterns. It uses regex patterns rather than glob, provides parallel command execution, and produces human-friendly output. fd aims to cover 80% of find use cases with simpler syntax while being faster through parallelization.
How do I run a basic fd example?
Run `fd [pattern]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -e _EXT_, --extension _EXT_ do in fd?
Filter by file extension.