xargs
Linux · Terminal · available in the simulator
What it does
Build and execute command lines from standard input.
Syntax
xargs [opciones] [comando]
Options and parameters
-nMaximum number of arguments per command line.
ls | xargs -n1 echo-IReplace occurrences of the specified string with each input item.
ls | xargs -I{} cp {} /tmp-0Input items are terminated by a null character; used with find -print0.
-PRun up to the specified number of processes in parallel.
Usage examples
printf '%s\n' a b | xargs echofind . -type f -print0 | xargs -0 rmls | xargs -n1 echols | xargs -I{} cp {} /tmp