Executes command (with any initial arguments),
but reads remaining arguments from standard input instead of
specifying them directly.
xargs passes these
arguments in several bundles to command,
allowing command to process more arguments than
it could normally handle at once. The arguments are typically a long
list of filenames (generated by
find, for example) that get passed to
xargs via a pipe.
Expect filenames to be terminated by NULL instead of whitespace. Do not treat quotes or backslashes specially.
Allow no more than args arguments on the command line. May be overridden by
Allow no more than max characters per command line.
Verbose mode. Print command line on standard error before executing.
If the maximum size (as specified by
-s) is exceeded, exit.
grep for pattern in all files
on the system, including those with spaces in their names:
find / -print0 | xargs -0 grep
> out &
diff on file pairs (e.g.,
echo $* | xargs -n2 diff
The previous line would be invoked as a shell script, specifying
filenames as arguments. Display file, one word
per line (same as
| xargs -n1