πŸ“¦ sharkdp / fd

A simple, fast and user-friendly alternative to 'find'

β˜… 41.9k stars β‘‚ 986 forks πŸ‘ 41.9k watching βš–οΈ Apache License 2.0
clicommand-linefilesystemhacktoberfestregexrustsearchterminaltool
πŸ“₯ Clone https://github.com/sharkdp/fd.git
HTTPS git clone https://github.com/sharkdp/fd.git
SSH git clone git@github.com:sharkdp/fd.git
CLI gh repo clone sharkdp/fd
Loading files...
πŸ“„ README.md

fd

CICD Version info [δΈ­ζ–‡] [ν•œκ΅­μ–΄]

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

Features

  • Intuitive syntax: fd PATTERN instead of find -iname '*PATTERN*'.
  • Regular expression (default) and glob-based patterns.
  • Very fast due to parallelized directory traversal.
  • Uses colors to highlight different file types (same as ls).
  • Supports parallel command execution
  • Smart case: the search is case-insensitive by default. It switches to
case-sensitive if the pattern contains an uppercase character\*.
  • Ignores hidden directories and files, by default.
  • Ignores patterns from your .gitignore, by default.
The command name is 50% shorter\ than find :-).

Sponsors

A special thank you goes to our biggest sponsor:

Tuple
Tuple, the premier screen sharing app for developers
Available for MacOS & Windows

Demo

Demo

How to use

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.

Simple search

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.