Skip to content
Myr

README.md

This file

Path

README.md

713 lines · 24.9 KiB · Markdown

Last changed by

Merge pull request #1534 from tmccombs/msrv-updateThayne McCombsbefore adoption8c7a84e

History of this file

Take it

The walk stopped after 200 commits: lines older than e9121ee point at it.

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

lines 1–4why, one step back
1# fd
23[![CICD](https://github.com/sharkdp/fd/actions/workflows/CICD.yml/badge.svg)](https://github.com/sharkdp/fd/actions/workflows/CICD.yml)4[![Version info](https://img.shields.io/crates/v/fd-find.svg)](https://crates.io/crates/fd-find)

Merge pull request #1255 from cha0ran/masterDavid Peterbefore adoption3ac2e13

line 5why, one step back
5[[中文](https://github.com/cha0ran/fd-zh)]

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

lines 6–12why, one step back
6[[한국어](https://github.com/spearkkk/fd-kor)]
78`fd` is a program to find entries in your filesystem.9It is a simple, fast and user-friendly alternative to [`find`](https://www.gnu.org/software/findutils/).10While it does not aim to support all of `find`'s powerful functionality, it provides sensible11(opinionated) defaults for a majority of use cases.12

Add Terminal Trove sponsorshipDavid Peterbefore adoption5b46867

lines 13–16why, one step back
13[Installation](#installation) • [How to use](#how-to-use) • [Troubleshooting](#troubleshooting)
1415## Sponsors16

More whitespaceDavid Peterbefore adoption969316c

lines 17–18why, one step back
17A special *thank you* goes to our biggest <a href="doc/sponsors.md">sponsors</a>:
18

Add Terminal Trove sponsorshipDavid Peterbefore adoption5b46867

lines 19–29why, one step back
19<a href="https://terminaltrove.com/?utm_campaign=github&utm_medium=referral&utm_content=fd&utm_source=fdgh">
20 <img src="doc/sponsors/terminal_trove_green.svg" width="200" alt="Terminal Trove">21 <br>22 <strong>The $HOME of all things in the terminal.</strong>23</a>24<br>25<a href="https://terminaltrove.com/newsletter?utm_campaign=github&utm_medium=referral&utm_content=fd&utm_source=fdgh">26 <sub>Find your next CLI / TUI tool and more at Terminal Trove,</sub>27 <br>28 <sup>Get updates on new tools on our newsletter.</sup>29</a>

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

lines 30–158why, one step back
30
31## Features3233* Intuitive syntax: `fd PATTERN` instead of `find -iname '*PATTERN*'`.34* Regular expression (default) and glob-based patterns.35* [Very fast](#benchmark) due to parallelized directory traversal.36* Uses colors to highlight different file types (same as `ls`).37* Supports [parallel command execution](#command-execution)38* Smart case: the search is case-insensitive by default. It switches to39 case-sensitive if the pattern contains an uppercase40 character[\*](http://vimdoc.sourceforge.net/htmldoc/options.html#'smartcase').41* Ignores hidden directories and files, by default.42* Ignores patterns from your `.gitignore`, by default.43* The command name is *50%* shorter[\*](https://github.com/ggreer/the_silver_searcher) than44 `find` :-).4546## Demo4748![Demo](doc/screencast.svg)4950## How to use5152First, to get an overview of all available command line options, you can either run53[`fd -h`](#command-line-options) for a concise help message or `fd --help` for a more detailed54version.5556### Simple search5758*fd* is designed to find entries in your filesystem. The most basic search you can perform is to59run *fd* with a single argument: the search pattern. For example, assume that you want to find an60old script of yours (the name included `netflix`):61``` bash62> fd netfl63Software/python/imdb-ratings/netflix-details.py64```65If called with just a single argument like this, *fd* searches the current directory recursively66for any entries that *contain* the pattern `netfl`.6768### Regular expression search6970The search pattern is treated as a regular expression. Here, we search for entries that start71with `x` and end with `rc`:72``` bash73> cd /etc74> fd '^x.*rc$'75X11/xinit/xinitrc76X11/xinit/xserverrc77```7879The regular expression syntax used by `fd` is [documented here](https://docs.rs/regex/1.0.0/regex/#syntax).8081### Specifying the root directory8283If we want to search a specific directory, it can be given as a second argument to *fd*:84``` bash85> fd passwd /etc86/etc/default/passwd87/etc/pam.d/passwd88/etc/passwd89```9091### List all files, recursively9293*fd* can be called with no arguments. This is very useful to get a quick overview of all entries94in the current directory, recursively (similar to `ls -R`):95``` bash96> cd fd/tests97> fd98testenv99testenv/mod.rs100tests.rs101```102103If you want to use this functionality to list all files in a given directory, you have to use104a catch-all pattern such as `.` or `^`:105``` bash106> fd . fd/tests/107testenv108testenv/mod.rs109tests.rs110```111112### Searching for a particular file extension113114Often, we are interested in all files of a particular type. This can be done with the `-e` (or115`--extension`) option. Here, we search for all Markdown files in the fd repository:116``` bash117> cd fd118> fd -e md119CONTRIBUTING.md120README.md121```122123The `-e` option can be used in combination with a search pattern:124``` bash125> fd -e rs mod126src/fshelper/mod.rs127src/lscolors/mod.rs128tests/testenv/mod.rs129```130131### Searching for a particular file name132133 To find files with exactly the provided search pattern, use the `-g` (or `--glob`) option:134``` bash135> fd -g libc.so /usr136/usr/lib32/libc.so137/usr/lib/libc.so138```139140### Hidden and ignored files141By default, *fd* does not search hidden directories and does not show hidden files in the142search results. To disable this behavior, we can use the `-H` (or `--hidden`) option:143``` bash144> fd pre-commit145> fd -H pre-commit146.git/hooks/pre-commit.sample147```148149If we work in a directory that is a Git repository (or includes Git repositories), *fd* does not150search folders (and does not show files) that match one of the `.gitignore` patterns. To disable151this behavior, we can use the `-I` (or `--no-ignore`) option:152``` bash153> fd num_cpu154> fd -I num_cpu155target/debug/deps/libnum_cpus-f5ce7ef99006aa05.rlib156```157158To really search *all* files and directories, simply combine the hidden and ignore features to show

Suggest to use `-u` instead of `-HI`David Peterbefore adoption00b64f3

line 159why, one step back
159everything (`-HI`) or use `-u`/`--unrestricted`.

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

lines 160–277why, one step back
160
161### Matching the full path162By default, *fd* only matches the filename of each file. However, using the `--full-path` or `-p` option,163you can match against the full path.164165```bash166> fd -p -g '**/.git/config'167> fd -p '.*/lesson-\d+/[a-z]+.(jpg|png)'168```169170### Command execution171172Instead of just showing the search results, you often want to *do something* with them. `fd`173provides two ways to execute external commands for each of your search results:174175* The `-x`/`--exec` option runs an external command *for each of the search results* (in parallel).176* The `-X`/`--exec-batch` option launches the external command once, with *all search results as arguments*.177178#### Examples179180Recursively find all zip archives and unpack them:181``` bash182fd -e zip -x unzip183```184If there are two such files, `file1.zip` and `backup/file2.zip`, this would execute185`unzip file1.zip` and `unzip backup/file2.zip`. The two `unzip` processes run in parallel186(if the files are found fast enough).187188Find all `*.h` and `*.cpp` files and auto-format them inplace with `clang-format -i`:189``` bash190fd -e h -e cpp -x clang-format -i191```192Note how the `-i` option to `clang-format` can be passed as a separate argument. This is why193we put the `-x` option last.194195Find all `test_*.py` files and open them in your favorite editor:196``` bash197fd -g 'test_*.py' -X vim198```199Note that we use capital `-X` here to open a single `vim` instance. If there are two such files,200`test_basic.py` and `lib/test_advanced.py`, this will run `vim test_basic.py lib/test_advanced.py`.201202To see details like file permissions, owners, file sizes etc., you can tell `fd` to show them203by running `ls` for each result:204``` bash205fd … -X ls -lhd --color=always206```207This pattern is so useful that `fd` provides a shortcut. You can use the `-l`/`--list-details`208option to execute `ls` in this way: `fd … -l`.209210The `-X` option is also useful when combining `fd` with [ripgrep](https://github.com/BurntSushi/ripgrep/) (`rg`) in order to search within a certain class of files, like all C++ source files:211```bash212fd -e cpp -e cxx -e h -e hpp -X rg 'std::cout'213```214215Convert all `*.jpg` files to `*.png` files:216``` bash217fd -e jpg -x convert {} {.}.png218```219Here, `{}` is a placeholder for the search result. `{.}` is the same, without the file extension.220See below for more details on the placeholder syntax.221222The terminal output of commands run from parallel threads using `-x` will not be interlaced or garbled,223so `fd -x` can be used to rudimentarily parallelize a task run over many files.224An example of this is calculating the checksum of each individual file within a directory.225```226fd -tf -x md5sum > file_checksums.txt227```228229#### Placeholder syntax230231The `-x` and `-X` options take a *command template* as a series of arguments (instead of a single string).232If you want to add additional options to `fd` after the command template, you can terminate it with a `\;`.233234The syntax for generating commands is similar to that of [GNU Parallel](https://www.gnu.org/software/parallel/):235236- `{}`: A placeholder token that will be replaced with the path of the search result237 (`documents/images/party.jpg`).238- `{.}`: Like `{}`, but without the file extension (`documents/images/party`).239- `{/}`: A placeholder that will be replaced by the basename of the search result (`party.jpg`).240- `{//}`: The parent of the discovered path (`documents/images`).241- `{/.}`: The basename, with the extension removed (`party`).242243If you do not include a placeholder, *fd* automatically adds a `{}` at the end.244245#### Parallel vs. serial execution246247For `-x`/`--exec`, you can control the number of parallel jobs by using the `-j`/`--threads` option.248Use `--threads=1` for serial execution.249250### Excluding specific files or directories251252Sometimes we want to ignore search results from a specific subdirectory. For example, we might253want to search all hidden files and directories (`-H`) but exclude all matches from `.git`254directories. We can use the `-E` (or `--exclude`) option for this. It takes an arbitrary glob255pattern as an argument:256``` bash257> fd -H -E .git …258```259260We can also use this to skip mounted directories:261``` bash262> fd -E /mnt/external-drive …263```264265.. or to skip certain file types:266``` bash267> fd -E '*.bak' …268```269270To make exclude-patterns like these permanent, you can create a `.fdignore` file. They work like271`.gitignore` files, but are specific to `fd`. For example:272``` bash273> cat ~/.fdignore274/mnt/external-drive275*.bak276```277

Merge pull request #1463 from Roshanjossey/patch-1Thayne McCombsbefore adoptionf483726

lines 278–280why, one step back
278> [!NOTE]
279> `fd` also supports `.ignore` files that are used by other programs such as `rg` or `ag`.280

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

lines 281–301why, one step back
281If you want `fd` to ignore these patterns globally, you can put them in `fd`'s global ignore file.
282This is usually located in `~/.config/fd/ignore` in macOS or Linux, and `%APPDATA%\fd\ignore` in283Windows.284285### Deleting files286287You can use `fd` to remove all files and directories that are matched by your search pattern.288If you only want to remove files, you can use the `--exec-batch`/`-X` option to call `rm`. For289example, to recursively remove all `.DS_Store` files, run:290``` bash291> fd -H '^\.DS_Store$' -tf -X rm292```293If you are unsure, always call `fd` without `-X rm` first. Alternatively, use `rm`s "interactive"294option:295``` bash296> fd -H '^\.DS_Store$' -tf -X rm -i297```298299If you also want to remove a certain class of directories, you can use the same technique. You will300have to use `rm`s `--recursive`/`-r` flag to remove directories.301

Merge pull request #1463 from Roshanjossey/patch-1Thayne McCombsbefore adoptionf483726

lines 302–303why, one step back
302> [!NOTE]
303> There are scenarios where using `fd … -X rm -r` can cause race conditions: if you have a

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

lines 304–313why, one step back
304path like `…/foo/bar/foo/…` and want to remove all directories named `foo`, you can end up in a
305situation where the outer `foo` directory is removed first, leading to (harmless) *"'foo/bar/foo':306No such file or directory"* errors in the `rm` call.307308### Command-line options309310This is the output of `fd -h`. To see the full set of command-line options, use `fd --help` which311also includes a much more detailed help text.312313```

Update Usage in ReadmeDavid Peterbefore adoptionbab7727

line 314why, one step back
314Usage: fd [OPTIONS] [pattern] [path]...

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

line 315why, one step back
315

Update Usage in ReadmeDavid Peterbefore adoptionbab7727

lines 316–318why, one step back
316Arguments:
317 [pattern] the search pattern (a regular expression, unless '--glob' is used; optional)318 [path]... the root directories for the filesystem search (optional)

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

line 319why, one step back
319

Update Usage in ReadmeDavid Peterbefore adoptionbab7727

lines 320–331why, one step back
320Options:
321 -H, --hidden Search hidden files and directories322 -I, --no-ignore Do not respect .(git|fd)ignore files323 -s, --case-sensitive Case-sensitive search (default: smart case)324 -i, --ignore-case Case-insensitive search (default: smart case)325 -g, --glob Glob-based search (default: regular expression)326 -a, --absolute-path Show absolute instead of relative paths327 -l, --list-details Use a long listing format with file metadata328 -L, --follow Follow symbolic links329 -p, --full-path Search full abs. path (default: filename only)330 -d, --max-depth <depth> Set maximum search depth (default: none)331 -E, --exclude <pattern> Exclude entries that match the given glob pattern

Merge pull request #1464 from Ato2207/dir_aliasThayne McCombsbefore adoption14ed023

lines 332–334why, one step back
332 -t, --type <filetype> Filter by type: file (f), directory (d/dir), symlink (l),
333 executable (x), empty (e), socket (s), pipe (p),334 block-device (b), char-device (c)

Update Usage in ReadmeDavid Peterbefore adoptionbab7727

lines 335–343why, one step back
335 -e, --extension <ext> Filter by file extension
336 -S, --size <size> Limit results based on the size of files337 --changed-within <date|dur> Filter by file modification time (newer than)338 --changed-before <date|dur> Filter by file modification time (older than)339 -o, --owner <user:group> Filter by owning user and/or group340 -x, --exec <cmd>... Execute a command for each search result341 -X, --exec-batch <cmd>... Execute a command with all search results at once342 -c, --color <when> When to use colors [default: auto] [possible values: auto,343 always, never]

Updates for 8.7.0Thayne McCombsbefore adoption840a565

lines 344–345why, one step back
344 -h, --help Print help (see more with '--help')
345 -V, --version Print version

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

lines 346–349why, one step back
346```
347348## Benchmark349

Update benchmark resultsDavid Peterbefore adoption61ebd9b

lines 350–351why, one step back
350Let's search my home folder for files that end in `[0-9].jpg`. It contains ~750.000
351subdirectories and about a 4 million files. For averaging and statistical analysis, I'm using

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

lines 352–356why, one step back
352[hyperfine](https://github.com/sharkdp/hyperfine). The following benchmarks are performed
353with a "warm"/pre-filled disk-cache (results for a "cold" disk-cache show the same trends).354355Let's start with `find`:356```

Update benchmark resultsDavid Peterbefore adoption61ebd9b

lines 357–359why, one step back
357Benchmark 1: find ~ -iregex '.*[0-9]\.jpg$'
358 Time (mean ± σ): 19.922 s ± 0.109 s359 Range (min … max): 19.765 s … 20.065 s

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

lines 360–363why, one step back
360```
361362`find` is much faster if it does not need to perform a regular-expression search:363```

Update benchmark resultsDavid Peterbefore adoption61ebd9b

lines 364–366why, one step back
364Benchmark 2: find ~ -iname '*[0-9].jpg'
365 Time (mean ± σ): 11.226 s ± 0.104 s366 Range (min … max): 11.119 s … 11.466 s

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

lines 367–368why, one step back
367```
368

Update benchmark resultsDavid Peterbefore adoption61ebd9b

line 369why, one step back
369Now let's try the same for `fd`. Note that `fd` performs a regular expression

Fixes typo in READMESayan Goswamibefore adoptionaeb4a5f

line 370why, one step back
370search by default. The options `-u`/`--unrestricted` option is needed here for

Update benchmark resultsDavid Peterbefore adoption61ebd9b

lines 371–372why, one step back
371a fair comparison. Otherwise `fd` does not have to traverse hidden folders and
372ignored paths (see below):

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

line 373why, one step back
373```

Update benchmark resultsDavid Peterbefore adoption61ebd9b

lines 374–376why, one step back
374Benchmark 3: fd -u '[0-9]\.jpg$' ~
375 Time (mean ± σ): 854.8 ms ± 10.0 ms376 Range (min … max): 839.2 ms … 868.9 ms

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

line 377why, one step back
377```

Update benchmark resultsDavid Peterbefore adoption61ebd9b

lines 378–380why, one step back
378For this particular example, `fd` is approximately **23 times faster** than `find -iregex`
379and about **13 times faster** than `find -iname`. By the way, both tools found the exact380same 546 files :smile:.

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

line 381why, one step back
381

Update benchmark resultsDavid Peterbefore adoption61ebd9b

lines 382–384why, one step back
382**Note**: This is *one particular* benchmark on *one particular* machine. While we have
383performed a lot of different tests (and found consistent results), things might384be different for you! We encourage everyone to try it out on their own. See

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

lines 385–386why, one step back
385[this repository](https://github.com/sharkdp/fd-benchmarks) for all necessary scripts.
386

Update benchmark resultsDavid Peterbefore adoption61ebd9b

lines 387–388why, one step back
387Concerning *fd*'s speed, a lot of credit goes to the `regex` and `ignore` crates that are
388also used in [ripgrep](https://github.com/BurntSushi/ripgrep) (check it out!).

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

lines 389–391why, one step back
389
390## Troubleshooting391

Update troubleshooting sectionDavid Peterbefore adoption07343b5

lines 392–400why, one step back
392### `fd` does not find my file!
393394Remember that `fd` ignores hidden directories and files by default. It also ignores patterns395from `.gitignore` files. If you want to make sure to find absolutely every possible file, always396use the options `-u`/`--unrestricted` option (or `-HI` to enable hidden and ignored files):397``` bash398> fd -u …399```400

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

lines 401–491why, one step back
401### Colorized output
402403`fd` can colorize files by extension, just like `ls`. In order for this to work, the environment404variable [`LS_COLORS`](https://linux.die.net/man/5/dir_colors) has to be set. Typically, the value405of this variable is set by the `dircolors` command which provides a convenient configuration format406to define colors for different file formats.407On most distributions, `LS_COLORS` should be set already. If you are on Windows or if you are looking408for alternative, more complete (or more colorful) variants, see [here](https://github.com/sharkdp/vivid),409[here](https://github.com/seebi/dircolors-solarized) or410[here](https://github.com/trapd00r/LS_COLORS).411412`fd` also honors the [`NO_COLOR`](https://no-color.org/) environment variable.413414### `fd` doesn't seem to interpret my regex pattern correctly415416A lot of special regex characters (like `[]`, `^`, `$`, ..) are also special characters in your417shell. If in doubt, always make sure to put single quotes around the regex pattern:418419``` bash420> fd '^[A-Z][0-9]+$'421```422423If your pattern starts with a dash, you have to add `--` to signal the end of command line424options. Otherwise, the pattern will be interpreted as a command-line option. Alternatively,425use a character class with a single hyphen character:426427``` bash428> fd -- '-pattern'429> fd '[-]pattern'430```431432### "Command not found" for `alias`es or shell functions433434Shell `alias`es and shell functions can not be used for command execution via `fd -x` or435`fd -X`. In `zsh`, you can make the alias global via `alias -g myalias="…"`. In `bash`,436you can use `export -f my_function` to make available to child processes. You would still437need to call `fd -x bash -c 'my_function "$1"' bash`. For other use cases or shells, use438a (temporary) shell script.439440## Integration with other programs441442### Using fd with `fzf`443444You can use *fd* to generate input for the command-line fuzzy finder [fzf](https://github.com/junegunn/fzf):445``` bash446export FZF_DEFAULT_COMMAND='fd --type file'447export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"448```449450Then, you can type `vim <Ctrl-T>` on your terminal to open fzf and search through the fd-results.451452Alternatively, you might like to follow symbolic links and include hidden files (but exclude `.git` folders):453``` bash454export FZF_DEFAULT_COMMAND='fd --type file --follow --hidden --exclude .git'455```456457You can even use fd's colored output inside fzf by setting:458``` bash459export FZF_DEFAULT_COMMAND="fd --type file --color=always"460export FZF_DEFAULT_OPTS="--ansi"461```462463For more details, see the [Tips section](https://github.com/junegunn/fzf#tips) of the fzf README.464465### Using fd with `rofi`466467[*rofi*](https://github.com/davatorium/rofi) is a graphical launch menu application that is able to create menus by reading from *stdin*. Piping `fd` output into `rofi`s `-dmenu` mode creates fuzzy-searchable lists of files and directories.468469#### Example470471Create a case-insensitive searchable multi-select list of *PDF* files under your `$HOME` directory and open the selection with your configured PDF viewer. To list all file types, drop the `-e pdf` argument.472473``` bash474fd --type f -e pdf . $HOME | rofi -keep-right -dmenu -i -p FILES -multi-select | xargs -I {} xdg-open {}475```476477To modify the list that is presented by rofi, add arguments to the `fd` command. To modify the search behaviour of rofi, add arguments to the `rofi` command.478479### Using fd with `emacs`480481The emacs package [find-file-in-project](https://github.com/technomancy/find-file-in-project) can482use *fd* to find files.483484After installing `find-file-in-project`, add the line `(setq ffip-use-rust-fd t)` to your485`~/.emacs` or `~/.emacs.d/init.el` file.486487In emacs, run `M-x find-file-in-project-by-selected` to find matching files. Alternatively, run488`M-x find-file-in-project` to list all available files in the project.489490### Printing the output as a tree491

Merge pull request #1386 from SonkeWohler/fix-readme-as-treeThayne McCombsbefore adoption19832fc

lines 492–493why, one step back
492To format the output of `fd` as a file-tree you can use the `tree` command with
493`--fromfile`:

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

line 494why, one step back
494```bash

Merge pull request #1386 from SonkeWohler/fix-readme-as-treeThayne McCombsbefore adoption19832fc

line 495why, one step back
495❯ fd | tree --fromfile

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

lines 496–497why, one step back
496```
497

Merge pull request #1386 from SonkeWohler/fix-readme-as-treeThayne McCombsbefore adoption19832fc

lines 498–500why, one step back
498This can be more useful than running `tree` by itself because `tree` does not
499ignore any files by default, nor does it support as rich a set of options as500`fd` does to control what to print:

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

line 501why, one step back
501```bash

Merge pull request #1386 from SonkeWohler/fix-readme-as-treeThayne McCombsbefore adoption19832fc

line 502why, one step back
502❯ fd --extension rs | tree --fromfile

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

lines 503–509why, one step back
503.
504├── build.rs505└── src506 ├── app.rs507 └── error.rs508```509

Merge pull request #1386 from SonkeWohler/fix-readme-as-treeThayne McCombsbefore adoption19832fc

lines 510–513why, one step back
510On bash and similar you can simply create an alias:
511```bash512❯ alias as-tree='tree --fromfile'513```

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

lines 514–545why, one step back
514
515### Using fd with `xargs` or `parallel`516517Note that `fd` has a builtin feature for [command execution](#command-execution) with518its `-x`/`--exec` and `-X`/`--exec-batch` options. If you prefer, you can still use519it in combination with `xargs`:520``` bash521> fd -0 -e rs | xargs -0 wc -l522```523Here, the `-0` option tells *fd* to separate search results by the NULL character (instead of524newlines). In the same way, the `-0` option of `xargs` tells it to read the input in this way.525526## Installation527528[![Packaging status](https://repology.org/badge/vertical-allrepos/fd-find.svg)](https://repology.org/project/fd-find/versions)529530### On Ubuntu531*... and other Debian-based Linux distributions.*532533If you run Ubuntu 19.04 (Disco Dingo) or newer, you can install the534[officially maintained package](https://packages.ubuntu.com/fd-find):535```536sudo apt install fd-find537```538Note that the binary is called `fdfind` as the binary name `fd` is already used by another package.539It is recommended that after installation, you add a link to `fd` by executing command540`ln -s $(which fdfind) ~/.local/bin/fd`, in order to use `fd` in the same way as in this documentation.541Make sure that `$HOME/.local/bin` is in your `$PATH`.542543If you use an older version of Ubuntu, you can download the latest `.deb` package from the544[release page](https://github.com/sharkdp/fd/releases) and install it via:545``` bash

Preprations for fd 9 releaseDavid Peterbefore adoptione3b4020

line 546why, one step back
546sudo dpkg -i fd_9.0.0_amd64.deb # adapt version number and architecture

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

lines 547–602why, one step back
547```
548549### On Debian550551If you run Debian Buster or newer, you can install the552[officially maintained Debian package](https://tracker.debian.org/pkg/rust-fd-find):553```554sudo apt-get install fd-find555```556Note that the binary is called `fdfind` as the binary name `fd` is already used by another package.557It is recommended that after installation, you add a link to `fd` by executing command558`ln -s $(which fdfind) ~/.local/bin/fd`, in order to use `fd` in the same way as in this documentation.559Make sure that `$HOME/.local/bin` is in your `$PATH`.560561### On Fedora562563Starting with Fedora 28, you can install `fd` from the official package sources:564``` bash565dnf install fd-find566```567568### On Alpine Linux569570You can install [the fd package](https://pkgs.alpinelinux.org/packages?name=fd)571from the official sources, provided you have the appropriate repository enabled:572```573apk add fd574```575576### On Arch Linux577578You can install [the fd package](https://www.archlinux.org/packages/community/x86_64/fd/) from the official repos:579```580pacman -S fd581```582### On Gentoo Linux583584You can use [the fd ebuild](https://packages.gentoo.org/packages/sys-apps/fd) from the official repo:585```586emerge -av fd587```588589### On openSUSE Linux590591You can install [the fd package](https://software.opensuse.org/package/fd) from the official repo:592```593zypper in fd594```595596### On Void Linux597598You can install `fd` via xbps-install:599```600xbps-install -S fd601```602

Update RHEL package infotkb-githubbefore adoption15329f9

line 603why, one step back
603### On RedHat Enterprise Linux 8/9 (RHEL8/9), Almalinux 8/9, EuroLinux 8/9 or Rocky Linux 8/9

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

line 604why, one step back
604

Update instructions for RHEL8 etc.tkb-githubbefore adoptionc62224d

lines 605–609why, one step back
605You can install [the `fd` package](https://copr.fedorainfracloud.org/coprs/tkbcopr/fd/) from Fedora Copr.
606607```bash608dnf copr enable tkbcopr/fd609dnf install fd

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

line 610why, one step back
610```

Update instructions for RHEL8 etc.tkb-githubbefore adoptionc62224d

line 611why, one step back
611

Update RHEL package infotkb-githubbefore adoption15329f9

line 612why, one step back
612A different version using the [slower](https://github.com/sharkdp/fd/pull/481#issuecomment-534494592) malloc [instead of jemalloc](https://bugzilla.redhat.com/show_bug.cgi?id=2216193#c1) is also available from the EPEL8/9 repo as the package `fd-find`.

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

lines 613–639why, one step back
613
614### On macOS615616You can install `fd` with [Homebrew](https://formulae.brew.sh/formula/fd):617```618brew install fd619```620621… or with MacPorts:622```623sudo port install fd624```625626### On Windows627628You can download pre-built binaries from the [release page](https://github.com/sharkdp/fd/releases).629630Alternatively, you can install `fd` via [Scoop](http://scoop.sh):631```632scoop install fd633```634635Or via [Chocolatey](https://chocolatey.org):636```637choco install fd638```639

Merge pull request #1256 from sitiom/patch-1David Peterbefore adoption3cf5ac0

lines 640–644why, one step back
640Or via [Winget](https://learn.microsoft.com/en-us/windows/package-manager/):
641```642winget install sharkdp.fd643```644

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

lines 645–679why, one step back
645### On GuixOS
646647You can install [the fd package](https://guix.gnu.org/en/packages/fd-8.1.1/) from the official repo:648```649guix install fd650```651652### On NixOS / via Nix653654You can use the [Nix package manager](https://nixos.org/nix/) to install `fd`:655```656nix-env -i fd657```658659### On FreeBSD660661You can install [the fd-find package](https://www.freshports.org/sysutils/fd) from the official repo:662```663pkg install fd-find664```665666### From npm667668On linux and macOS, you can install the [fd-find](https://npm.im/fd-find) package:669670```671npm install -g fd-find672```673674### From source675676With Rust's package manager [cargo](https://github.com/rust-lang/cargo), you can install *fd* via:677```678cargo install fd-find679```

Merge pull request #1534 from tmccombs/msrv-updateThayne McCombsbefore adoption8c7a84e

line 680why, one step back
680Note that rust version *1.77.2* or later is required.

Remove trailing spaces from README.mdFrieder Bluemlebefore adoptione9121ee

lines 681–713why, one step back
681
682`make` is also needed for the build.683684### From binaries685686The [release page](https://github.com/sharkdp/fd/releases) includes precompiled binaries for Linux, macOS and Windows. Statically-linked binaries are also available: look for archives with `musl` in the file name.687688## Development689```bash690git clone https://github.com/sharkdp/fd691692# Build693cd fd694cargo build695696# Run unit tests and integration tests697cargo test698699# Install700cargo install --path .701```702703## Maintainers704705- [sharkdp](https://github.com/sharkdp)706- [tmccombs](https://github.com/tmccombs)707- [tavianator](https://github.com/tavianator)708709## License710711`fd` is distributed under the terms of both the MIT License and the Apache License 2.0.712713See the [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) files for license details.