1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/xargs.md
Andrei Cioara eb1f864263 shortened xargs (#878)
rest_of_arguments was misleading
2016-05-16 07:47:07 +01:00

406 B

xargs

Execute a command with piped arguments.

  • Main use:

{{arguments}} | xargs {{command}}

  • Handle whitespace in arguments:

{{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:

{{arguments}} | xargs -I % {{command}} % {{extra_arguments}}