Xargs

xargs reads whitespace-separated strings from stdin and passes them as arguments to a command, e.g.

$ echo {00..10}
00 01 02 03 04 05 06 07 08 09 10

$ echo {00..10} | xargs echo
00 01 02 03 04 05 06 07 08 09 10

The -n flag splits the input values into n-sized blocks per-invocation of the command, e.g.

$ echo {00..10} | xargs -n 1 echo
00
01
02
03
04
05
06
07
08
09
10

$ echo {00..10} | xargs -n 3 echo
00 01 02
03 04 05
06 07 08
09 10

The -t flag prints the command to stderr before executing it, e.g.

$ echo {00..10} | xargs -t -n 3 echo
echo 00 01 02
00 01 02
echo 03 04 05
03 04 05
echo 06 07 08
06 07 08
echo 09 10
09 10

The -P flag sets the number of parallel processess to use when invoking the command, e.g.

$ echo {00..10} | xargs -t -P 2 -n 3 echo
echo 00 01 02
echo 03 04 05
00 01 02
echo 06 07 08
03 04 05
echo 09 10
06 07 08
09 10