xargs
xargs is a command on Unix and most Unix-like operating systems used to build and execute command lines from standard input. Commands such as grep
and awk
can accept the standard input as a parameter, or argument by using a pipe. However, others such as cp
and echo
disregard the standard input stream and rely solely on the arguments found after the command. Additionally, under the Linux kernel before version 2.6.23, and under many other Unix-like systems, arbitrarily long lists of parameters cannot be passed to a command, so xargs
breaks the list of arguments into sublists small enough to be acceptable.