1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-06-05 21:06:00 +02:00
tldr/pages/common/xargs.md

20 lines
406 B
Markdown
Raw Normal View History

2014-03-12 18:25:30 +01:00
# xargs
> Execute a command with piped arguments.
2014-03-12 18:25:30 +01:00
- Main use:
2014-03-12 18:25:30 +01:00
`{{arguments}} | xargs {{command}}`
- Handle whitespace in arguments:
2014-03-12 18:25:30 +01:00
`{{arguments_null_terminated}} | xargs -0 {{command}}`
- Delete all files that start with 'M':
2014-03-12 18:25:30 +01:00
`find . -name 'M*' | xargs rm`
- Insert arguments at chosen position, using '%' as the placeholder marker:
2014-03-12 18:25:30 +01:00
`{{arguments}} | xargs -I % {{command}} % {{extra_arguments}}`