2014-03-12 17:25:30 +00:00
|
|
|
# xargs
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Execute a command with piped arguments.
|
2014-03-12 17:25:30 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Main use:
|
2014-03-12 17:25:30 +00:00
|
|
|
|
|
|
|
`{{arguments}} | xargs {{command}}`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Handling whitespace in arguments:
|
2014-03-12 17:25:30 +00:00
|
|
|
|
|
|
|
`{{arguments_null_terminated}} | xargs -0 {{command}}`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Example: list unneeded packages with deborphan and remove them with apt-get:
|
2014-03-12 17:25:30 +00:00
|
|
|
|
|
|
|
`sudo deborphan | xargs sudo apt-get remove`
|