xargs is a command on Unix and most Unix-like operating systems used to build and execute command lines from standard input.
xargs is a command on Unix and most Unix-like operating systems used to build and execute command lines from standard input. Under the Linux kernel before version 2.6.23, arbitrarily long lists of parameters could not be passed to a command, so xargs breaks the list of arguments into sublists small enough to be acceptable.
xargs
often covers the same functionality as the backquote
(`)
feature of many shells, but is more flexible and often also safer, especially if there are blanks or special characters in the input. It is a good companion for commands that output long lists of files like find
, locate
and grep
, but only if you use -0
, since xargs
without -0
deals badly with file names containing ', "
and space
.