Skip to content
Myr

Explain what will be executed

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Peter · committed by David Peter · parent d283aba · Browse files · 1 file+8 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−4 removed

  • other:+8 added−4 removed

1 file+8 added−4 removed

modified:README.md+8 added-4 removed
145 unmodified lines
146* The `-X`/`--exec-batch` option launches the external command once, with *all search results as arguments*.147148#### Examples149150Recursively find all zip archives and unpack them in parallel:150Recursively find all zip archives and unpack them:151``` bash152fd -e zip -x unzip153```154If there are two such files, `file1.zip` and `backup/file2.zip`, this would execute155`unzip file1.zip` and `unzip backup/file2.zip`. The two `unzip` processes run in parallel156(if the files are found fast enough).157158Find all `*.h` and `*.cpp` files and auto-format them inplace with `clang-format -i`:159``` bash160fd -e h -e cpp -x clang-format -i
4 unmodified lines
165Find all `test_*.py` files and open them in your favorite editor:166``` bash167fd -g 'test_*.py' -X vim168```166Note that we use capital `-X` here to open a single `vim` instance, with all search results as167arguments.169Note that we use capital `-X` here to open a single `vim` instance. If there are two such files,170`test_basic.py` and `lib/test_advanced.py`, this will run `vim test_basic.py lib/test_advanced.py`.171169See details like file permissions, owners, file sizes etc. by running `ls -l`:172To see details like file permissions, owners, file sizes etc., you can tell `fd` to show them173by running `ls` for each result:174``` bash175fd … -X ls -lhd --color=always176```177This pattern is so useful that `fd` provides a shortcut. You can use the `-l`/`--list-details`
464 unmodified lines