utility
xargs
Build argument vectors from input. -0 reads NUL-delimited items; GNU -r skips empty input. Nonzero child statuses can map to xargs-specific statuses.
Formal Syntax & Structure
bash syntaxbash
xargs -0 [-r] COMMAND [ARG ...]Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| COMMAND | string | Executable to invoke. |
| -0 | option | Read NUL-separated records. |
| -r | option | Skip execution on empty input (implementation-sensitive). |
Return Value
exit status
Exit status 0 on success; nonzero indicates failure or a command-specific condition. See description and example.
Working Example
Example Snippetbash
mkdir datatouch -- $'data/line\nbreak.txt'find data -type f -print0 | xargs -0 -r printf '[%s]\n'