Remove xargs section from How-to

This commit is contained in:
David Peter 2021-02-14 11:27:44 +01:00
parent 371794047a
commit 98738d2ac1
1 changed files with 11 additions and 9 deletions

View File

@ -170,15 +170,6 @@ If you want `fd` to ignore these patterns globally, you can put them in `fd`'s g
This is usually located in `~/.config/fd/ignore` in macOS or Linux, and `%APPDATA%\fd\ignore` in
Windows.
### Using fd with `xargs` or `parallel`
If we want to run a command on all search results, we can pipe the output to `xargs`:
``` bash
> fd -0 -e rs | xargs -0 wc -l
```
Here, the `-0` option tells *fd* to separate search results by the NULL character (instead of
newlines). In the same way, the `-0` option of `xargs` tells it to read the input in this way.
### Parallel command execution
If the `-x`/`--exec` option is specified alongside a command template, a job pool will be created
@ -446,6 +437,17 @@ For more information about `as-tree`, see [the `as-tree` README][`as-tree`].
[`as-tree`]: https://github.com/jez/as-tree
### Using fd with `xargs` or `parallel`
Note that `fd` has a builtin feature for [command execution](#parallel-command-execution) with
its `-x`/`--exec` and `-X`/`--exec-batch` options. If you prefer, you can still use
it in combination with `xargs`:
``` bash
> fd -0 -e rs | xargs -0 wc -l
```
Here, the `-0` option tells *fd* to separate search results by the NULL character (instead of
newlines). In the same way, the `-0` option of `xargs` tells it to read the input in this way.
## Installation
[![Packaging status](https://repology.org/badge/vertical-allrepos/fd-find.svg)](https://repology.org/project/fd-find/versions)