summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Peter <mail@david-peter.de>2021-02-14 19:59:53 +0100
committerDavid Peter <mail@david-peter.de>2021-02-14 19:59:53 +0100
commit4ebb3bbc81fd30afabb8f4115e6719c6a527c11d (patch)
treeb3c26948a87feb723fecb8caf8565554f9685eae
parentd283aba52e737b8ac21742abd84c2046c00e9148 (diff)
Explain what will be executed
-rw-r--r--README.md12
1 files changed, 8 insertions, 4 deletions
diff --git a/README.md b/README.md
index c0e1451..67532d3 100644
--- a/README.md
+++ b/README.md
@@ -147,10 +147,13 @@ provides two ways to execute external commands for each of your search results:
#### Examples
-Recursively find all zip archives and unpack them in parallel:
+Recursively find all zip archives and unpack them:
``` bash
fd -e zip -x unzip
```
+If there are two such files, `file1.zip` and `backup/file2.zip`, this would execute
+`unzip file1.zip` and `unzip backup/file2.zip`. The two `unzip` processes run in parallel
+(if the files are found fast enough).
Find all `*.h` and `*.cpp` files and auto-format them inplace with `clang-format -i`:
``` bash
@@ -163,10 +166,11 @@ Find all `test_*.py` files and open them in your favorite editor:
``` bash
fd -g 'test_*.py' -X vim
```
-Note that we use capital `-X` here to open a single `vim` instance, with all search results as
-arguments.
+Note that we use capital `-X` here to open a single `vim` instance. If there are two such files,
+`test_basic.py` and `lib/test_advanced.py`, this will run `vim test_basic.py lib/test_advanced.py`.
-See details like file permissions, owners, file sizes etc. by running `ls -l`:
+To see details like file permissions, owners, file sizes etc., you can tell `fd` to show them
+by running `ls` for each result:
``` bash
fd … -X ls -lhd --color=always
```