src | ||
tests | ||
.gitignore | ||
.travis.yml | ||
Cargo.lock | ||
Cargo.toml | ||
LICENSE | ||
README.md |
fd
fd is a simple, fast and user-friendly alternative to find.
While it does not seek to mirror all of find's powerful functionality, it provides sensible (opinionated) defaults for 80% of the use cases.
Features
- Convenient syntax:
fd PATTERN
instead offind -iname '*PATTERN*'
. - Smart case: the search is case-insensitive by default. It switches to case-sensitive if the pattern contains an uppercase character*.
- Colorized terminal output (similar to ls).
- Ignores hidden directories and files, by default.
- Ignores patterns from your
.gitignore
, by default. - Regular expressions.
- Unicode-awareness.
- The command name is 50% shorter* than
find
:-).
Demo
Colorized output
fd
can colorize files by extension, just like ls
. In order for this to work, the environment
variable LS_COLORS
has to be set. Typically, the value
of this variable is set by the dircolors
command which provides a convenient configuration format
to define colors for different file formats.
On most distributions, LS_COLORS
should be set already. If you are looking for alternative, more
complete (and more colorful) variants, see
here or
here.
Benchmark
A search in my home folder with ~150.000 subdirectories and ~1M files. The given options for
fd
are needed for a fair comparison (otherwise fd
is even faster by a factor of 4 because it
does not have to search hidden and ignored paths):
> time fd --hidden --no-ignore --full-path '.*[0-9]\.jpg$' > /dev/null
1,03s user 0,92s system 99% cpu 1,961 total
> time find -iregex '.*[0-9]\.jpg$' > /dev/null
3,98s user 0,84s system 99% cpu 4,832 total
Both tools found the exact same 14030 files and the results are comparable when averaged over multiple runs.
Install
With cargo, you can clone, build and install fd with a single command:
cargo install --git https://github.com/sharkdp/fd
The release page of this repository also includes precompiled binaries for Linux.
Development
cargo build --release