A simple, fast and user-friendly alternative to 'find'
https://github.com/sharkdp/fd.git
fd is a program to find entries in your filesystem.
It is a simple, fast and user-friendly alternative to find.
While it does not aim to support all of find's powerful functionality, it provides sensible
(opinionated) defaults for a majority of use cases.
Installation β’ How to use β’ Troubleshooting
fd PATTERN instead of find -iname '*PATTERN*'.ls)..gitignore, by default.find :-).
A special thank you goes to our biggest sponsor:
Tuple, the premier screen sharing app for developers
Available for MacOS & Windows
First, to get an overview of all available command line options, you can either run
fd -h for a concise help message or fd --help for a more detailed
version.
fd is designed to find entries in your filesystem. The most basic search you can perform is to
run fd with a single argument: the search pattern. For example, assume that you want to find an
old script of yours (the name included netflix):
`` bash
> fd netfl
Software/python/imdb-ratings/netflix-details.py
%%CODEBLOCK0%% bash
> cd /etc
> fd '^x.*rc`
## Maintainers
- [sharkdp](https://github.com/sharkdp)
- [tmccombs](https://github.com/tmccombs)
- [tavianator](https://github.com/tavianator)
## License
fd` is distributed under the terms of both the MIT License and the Apache License 2.0.
See the LICENSE-APACHE and LICENSE-MIT files for license details.
X11/xinit/xinitrc X11/xinit/xserverrc %%CODEBLOCK1%% bash > fd passwd /etc /etc/default/passwd /etc/pam.d/passwd /etc/passwd %%CODEBLOCK2%% bash > cd fd/tests > fd testenv testenv/mod.rs tests.rs %%CODEBLOCK3%% bash > fd . fd/tests/ testenv testenv/mod.rs tests.rs %%CODEBLOCK4%% bash > cd fd > fd -e md CONTRIBUTING.md README.md %%CODEBLOCK5%% bash > fd -e rs mod src/fshelper/mod.rs src/lscolors/mod.rs tests/testenv/mod.rs %%CODEBLOCK6%% bash > fd -g libc.so /usr /usr/lib32/libc.so /usr/lib/libc.so %%CODEBLOCK7%% bash > fd pre-commit > fd -H pre-commit .git/hooks/pre-commit.sample %%CODEBLOCK8%% bash > fd num_cpu > fd -I num_cpu target/debug/deps/libnum_cpus-f5ce7ef99006aa05.rlib %%CODEBLOCK9%%bash > fd -p -g '**/.git/config' > fd -p '.*/lesson-\d+/[a-z]+.(jpg|png)' %%CODEBLOCK10%% bash fd -e zip -x unzip %%CODEBLOCK11%% bash fd -e h -e cpp -x clang-format -i %%CODEBLOCK12%% bash fd -g 'test_*.py' -X vim %%CODEBLOCK13%% bash fd β¦ -X ls -lhd --color=always %%CODEBLOCK14%%bash fd -e cpp -e cxx -e h -e hpp -X rg 'std::cout' %%CODEBLOCK15%% bash fd -e jpg -x convert {} {.}.png %%CODEBLOCK16%% fd -tf -x md5sum > file_checksums.txt %%CODEBLOCK17%% bash > fd -H -E .git β¦ %%CODEBLOCK18%% bash > fd -E /mnt/external-drive β¦ %%CODEBLOCK19%% bash > fd -E '*.bak' β¦ %%CODEBLOCK20%% bash > cat ~/.fdignore /mnt/external-drive *.bak %%CODEBLOCK21%% bash > fd -H '^\.DS_Store`%%INLINECODE12%%fd` is distributed under the terms of both the MIT License and the Apache License 2.0.See the LICENSE-APACHE and LICENSE-MIT files for license details.
-tf -X rm %%CODEBLOCK22%% bash > fd -H '^\.DS_Store`%%INLINECODE12%%fd` is distributed under the terms of both the MIT License and the Apache License 2.0.See the LICENSE-APACHE and LICENSE-MIT files for license details.
-tf -X rm -i %%CODEBLOCK23%% Usage: fd [OPTIONS] [pattern [path]...] Arguments: [pattern] the search pattern (a regular expression, unless '--glob' is used; optional) [path]... the root directories for the filesystem search (optional) Options: -H, --hidden Search hidden files and directories -I, --no-ignore Do not respect .(git|fd)ignore files -s, --case-sensitive Case-sensitive search (default: smart case) -i, --ignore-case Case-insensitive search (default: smart case) -g, --glob Glob-based search (default: regular expression) -a, --absolute-path Show absolute instead of relative paths -l, --list-details Use a long listing format with file metadata -L, --follow Follow symbolic links -p, --full-path Search full abs. path (default: filename only) -d, --max-depth <depth> Set maximum search depth (default: none) -E, --exclude <pattern> Exclude entries that match the given glob pattern -t, --type <filetype> Filter by type: file (f), directory (d/dir), symlink (l), executable (x), empty (e), socket (s), pipe (p), char-device (c), block-device (b) -e, --extension <ext> Filter by file extension -S, --size <size> Limit results based on the size of files --changed-within <date|dur> Filter by file modification time (newer than) --changed-before <date|dur> Filter by file modification time (older than) -o, --owner <user:group> Filter by owning user and/or group --format <fmt> Print results according to template -x, --exec <cmd>... Execute a command for each search result -X, --exec-batch <cmd>... Execute a command with all search results at once -c, --color <when> When to use colors [default: auto] [possible values: auto, always, never] --hyperlink[=<when>] Add hyperlinks to output paths [default: never] [possible values: auto, always, never] --ignore-contain <name> Ignore directories containing the named entry -h, --help Print help (see more with '--help') -V, --version Print version %%CODEBLOCK24%% Benchmark 1: find ~ -iregex '.*[0-9]\.jpg`%%INLINECODE12%%fd` is distributed under the terms of both the MIT License and the Apache License 2.0.See the LICENSE-APACHE and LICENSE-MIT files for license details.
Time (mean Β± Ο): 19.922 s Β± 0.109 s Range (min β¦ max): 19.765 s β¦ 20.065 s %%CODEBLOCK25%% Benchmark 2: find ~ -iname '*[0-9].jpg' Time (mean Β± Ο): 11.226 s Β± 0.104 s Range (min β¦ max): 11.119 s β¦ 11.466 s %%CODEBLOCK26%% Benchmark 3: fd -u '[0-9]\.jpg`%%INLINECODE12%%fd` is distributed under the terms of both the MIT License and the Apache License 2.0.See the LICENSE-APACHE and LICENSE-MIT files for license details.
~ Time (mean Β± Ο): 854.8 ms Β± 10.0 ms Range (min β¦ max): 839.2 ms β¦ 868.9 ms %%CODEBLOCK27%% bash > fd -u β¦ %%CODEBLOCK28%% bash > fd '^[A-Z][0-9]+`%%INLINECODE12%%fd` is distributed under the terms of both the MIT License and the Apache License 2.0.See the LICENSE-APACHE and LICENSE-MIT files for license details.
%%CODEBLOCK29%% bash > fd -- '-pattern' > fd '[-]pattern' %%CODEBLOCK30%% bash export FZF_DEFAULT_COMMAND='fd --type file' export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" %%CODEBLOCK31%% bash export FZF_DEFAULT_COMMAND='fd --type file --follow --hidden --exclude .git' %%CODEBLOCK32%% bash export FZF_DEFAULT_COMMAND="fd --type file --color=always" export FZF_DEFAULT_OPTS="--ansi" %%CODEBLOCK33%% bash fd --type f -e pdf . $HOME | rofi -keep-right -dmenu -i -p FILES -multi-select | xargs -I {} xdg-open {} %%CODEBLOCK34%%bash β― fd | tree --fromfile %%CODEBLOCK35%%bash β― fd --extension rs | tree --fromfile . βββ build.rs βββ src βββ app.rs βββ error.rs %%CODEBLOCK36%%bash β― alias as-tree='tree --fromfile' %%CODEBLOCK37%% bash > fd -0 -e rs | xargs -0 wc -l %%CODEBLOCK38%% apt install fd-find %%CODEBLOCK39%% bash dpkg -i fd_9.0.0_amd64.deb # adapt version number and architecture %%CODEBLOCK40%% apt-get install fd-find %%CODEBLOCK41%% bash dnf install fd-find %%CODEBLOCK42%% apk add fd %%CODEBLOCK43%% pacman -S fd %%CODEBLOCK44%% emerge -av fd %%CODEBLOCK45%% zypper in fd %%CODEBLOCK46%% xbps-install -S fd %%CODEBLOCK47%% apt-get install fd %%CODEBLOCK48%% eopkg install fd %%CODEBLOCK49%%bash dnf copr enable tkbcopr/fd dnf install fd %%CODEBLOCK50%% brew install fd %%CODEBLOCK51%% port install fd %%CODEBLOCK52%% scoop install fd %%CODEBLOCK53%% choco install fd %%CODEBLOCK54%% winget install sharkdp.fd %%CODEBLOCK55%% guix install fd %%CODEBLOCK56%% mise use -g fd@latest %%CODEBLOCK57%% nix-env -i fd %%CODEBLOCK58%% flox install fd %%CODEBLOCK59%% pkg install fd-find %%CODEBLOCK60%% npm install -g fd-find %%CODEBLOCK61%% cargo install fd-find %%CODEBLOCK62%%bash git clone https://github.com/sharkdp/fd # Build cd fd cargo build # Run unit tests and integration tests cargo test # Install cargo install --path . %%CODEBLOCK63%%bash # Bash fd --gen-completions bash > ~/.local/share/bash-completion/completions/fd # Zsh (ensure ~/.zfunc is in your fpath) fd --gen-completions zsh > ~/.zfunc/_fd # Fish fd --gen-completions fish > ~/.config/fish/completions/fd.fish # PowerShell fd --gen-completions powershell >> $PROFILE `%%INLINECODE12%%fd` is distributed under the terms of both the MIT License and the Apache License 2.0.See the LICENSE-APACHE and LICENSE-MIT files for license details.