fd — A Simple Fast User-Friendly Alternative to find
fd is a simple, fast, and user-friendly alternative to the venerable find command. Written in Rust with smart defaults: color output, gitignore-aware, parallel traversal, and intuitive syntax. Used by VS Code, Helix, and many dev tools.
Agent 可直接安装
这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。
npx -y tokrepo@latest install 224ccbe5-35d4-11f1-9bc6-00163e2b0d79 --target codex先 dry-run 确认安装计划,再运行此命令。
What it is
fd is a command-line tool written in Rust that finds files and directories. It provides a simpler syntax and smarter defaults compared to the traditional find command. Features include colorized output, automatic gitignore filtering, regex patterns by default, and parallel directory traversal.
The tool targets developers and system administrators who use file search frequently and want faster results with less typing. It is used internally by VS Code, Helix editor, and many developer tools.
How it saves time or tokens
fd requires less typing than find for common operations. Where find needs -name '*.js' -type f, fd uses -e js. It automatically respects .gitignore files, so search results exclude build artifacts and dependencies without manual exclusion patterns.
Parallel directory traversal makes fd significantly faster than find on large directory trees, especially on SSDs. The speed difference grows with directory depth and file count.
How to use
- Install with your package manager:
brew install fd(macOS),sudo apt install fd-find(Debian), orcargo install fd-find. - Run
fd patternto search for files matching a regex pattern in the current directory. - Add flags for extensions (
-e js), file types (-t ffor files,-t dfor directories), or hidden files (-H).
Example
# Find files matching a pattern
fd pattern
# Find by extension
fd -e js
fd -e md -e mdx
# Include hidden files
fd -H config
# Find directories only
fd -t d src
# Execute command per match
fd -e log -x gzip {}
# Search specific path
fd pattern path/to/search
# Ignore gitignore rules
fd -I pattern
Related on TokRepo
- Automation tools -- CLI utilities for developer productivity
- AI tools for coding -- Developer tools and code search
Common pitfalls
- On Debian and Ubuntu, the binary is named
fdfindinstead offddue to a naming conflict with another package. Create an alias withalias fd=fdfindin your shell config. - fd ignores hidden files and directories by default. Use the
-Hflag to include dotfiles like .env, .config, or .git contents. - fd respects .gitignore by default. If you need to find files inside node_modules or build directories, add the
-Iflag to disable gitignore filtering.
常见问题
fd is typically 2-10x faster than find due to parallel directory traversal and Rust's efficient I/O. The difference is most noticeable on large directory trees with thousands of files. On small directories, both tools are fast enough that speed is not a factor.
Yes. fd uses regex patterns by default. Type fd 'test.*\.js$' to find files matching a regex. For simple glob-like patterns, the regex is usually just the search term. Use -g for glob mode if you prefer glob syntax.
fd can replace find for most file search tasks but has a different flag syntax. Existing scripts using find need modification. fd also has a different default behavior (ignoring hidden files and gitignored paths) which may change results compared to find.
Yes. fd supports Windows, Linux, and macOS. On Windows, install via scoop (scoop install fd) or chocolatey. The tool handles Windows path separators and case sensitivity correctly.
fd reads .gitignore, .fdignore, and .ignore files and excludes matching paths from results. This happens automatically. To disable this behavior and search all files, use the -I (no-ignore) flag. You can also create .fdignore files for fd-specific exclusions.
引用来源 (3)
- fd GitHub— fd is a simple fast user-friendly alternative to find written in Rust
- fd README— Used by VS Code and Helix editor
- fd Benchmarks— Parallel directory traversal using Rust
讨论
相关资产
Lit — Simple Library for Fast Lightweight Web Components
Lit is a simple library for building fast, lightweight web components. Built by Google on top of the standard Web Components APIs, it provides reactive properties, scoped styles, and a declarative templating system in about 5KB.
fnm — Fast and Simple Node.js Version Manager
fnm (Fast Node Manager) is a blazing-fast Node.js version manager built in Rust. It installs and switches Node.js versions instantly, supports .node-version and .nvmrc files, and is 40x faster than nvm with cross-platform support.
SFML — Simple and Fast Multimedia Library for C++
A cross-platform C++ library providing a simple interface to graphics, audio, networking, and system hardware for games and multimedia applications.
xsv — Fast CSV Toolkit Written in Rust
xsv is a blazing-fast command-line toolkit for working with CSV data. It provides indexing, slicing, searching, joining, aggregation, and statistics — processing millions of rows per second for data analysis, ETL pipelines, and CSV manipulation.