The xargs command

The xargs command builds command lines from standard input.

xargs [options] [command [initial arguments]]

With no arguments, xargs will take strings from standard input, strip off the newlines, and echo them to standard output. However, if you specify a command, xargs will use the data from standard input as the arguments for the command.

Common options:

-t
Verbose output. Prints the command to standard error before executing it.
-p
Run the commands in interactive mode, prompting the user before running each command.

-i
Replace a string ({} by default) in the initial arguments with the strings read from standard input.

Examples:


Next topic: sed