mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-08-04 20:35:34 +02:00
xargs: add example as discussed in #878
Also moved the concrete example to the end.
This commit is contained in:
parent
eb1f864263
commit
f26d5164ae
1 changed files with 9 additions and 5 deletions
|
@ -10,10 +10,14 @@
|
||||||
|
|
||||||
`{{arguments_null_terminated}} | xargs -0 {{command}}`
|
`{{arguments_null_terminated}} | xargs -0 {{command}}`
|
||||||
|
|
||||||
- Delete all files that start with 'M':
|
|
||||||
|
|
||||||
`find . -name 'M*' | xargs rm`
|
|
||||||
|
|
||||||
- Insert arguments at chosen position, using '%' as the placeholder marker:
|
- Insert arguments at chosen position, using '%' as the placeholder marker:
|
||||||
|
|
||||||
`{{arguments}} | xargs -I % {{command}} % {{extra_arguments}}`
|
`{{arguments}} | xargs -I '%' {{command}} % {{extra_arguments}}`
|
||||||
|
|
||||||
|
- Use the output of one command as arguments to another command:
|
||||||
|
|
||||||
|
`{{command1}} | xargs {{command2}}`
|
||||||
|
|
||||||
|
- Specific example: delete all files that start with 'M':
|
||||||
|
|
||||||
|
`find . -name 'M*' | xargs rm`
|
||||||
|
|
Loading…
Add table
Reference in a new issue