commands
xargs — build argument lists
Builds batches of arguments from input. Default whitespace and quoting rules are unsuitable for arbitrary paths. -0 reads NUL-delimited input; GNU -r skips empty input. Status can reflect child failures; 123 indicates a child exited 1–125. Example assumes a fresh search-transform lab fixture.
Formal Syntax & Structure
linux syntaxlinux
xargs [OPTION]... [COMMAND [INITIAL-ARGS]]Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| -0 | option | Read NUL-separated arguments; disable quote and backslash parsing. |
| -r | option | GNU extension: do not invoke command if no input arguments. |
| COMMAND | operand | Executable to invoke; GNU xargs defaults to echo if omitted. |
| INITIAL-ARGS | operand | Fixed arguments placed before each batch of input arguments. |
Return Value
exit status and output
Builds batches of arguments from input. Default whitespace and quoting rules are unsuitable for arbitrary paths. -0 reads NUL-delimited input; GNU -r skips empty input. Status can reflect child failures; 123 indicates a child exited 1–125.
Working Example
Example Snippetlinux
printf 'a b\0c\0' | xargs -0 -r printf '[%s]\n'