mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-18 02:49:45 +00:00
Update cheatsheets
This commit is contained in:
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# xargs
|
||||
|
||||
> Execute a command with piped arguments coming from another command, a file, etc.
|
||||
> The input is treated as a single block of text and split into separate pieces on spaces, tabs, newlines and end-of-file.
|
||||
> The input is treated as a single block of text and split into separate pieces on spaces, tabs, newlines, and end-of-file.
|
||||
> More information: <https://www.gnu.org/software/findutils/manual/html_mono/find.html#Invoking-xargs>.
|
||||
|
||||
- Run a command using the input data as arguments:
|
||||
@@ -17,7 +17,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`{{arguments_source}} | xargs sh -c "{{command1}} && {{command2}} | {{command3}}"`
|
||||
|
||||
- Gzip all files with `.log` extension taking advantage of multiple threads (`-print0` uses a null character to split file names, and `-0` uses it as delimiter):
|
||||
- Gzip all files with `.log` extension taking advantage of multiple threads (`-print0` uses a null character to split file names and `--null` uses it as delimiter):
|
||||
|
||||
`find . -name '*.log' -print0 | xargs {{[-0|--null]}} {{[-P|--max-procs]}} {{4}} {{[-n|--max-args]}} 1 gzip`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user