I\'m pretty much confused on this. Need some clarifications.
Example 1 :
pgrep string | xargs ps
Example 2 :>
$ echo 'line1
> line2
> line3
> ...
> lineN ' | xargs cmd1 -a -b
will result in:
$ cmd1 -a -b line1 line2 line3 ... lineN
xargs
will break cmd1 ...
into several executions of cmd1
if the line count gets too large.
xargs
may be used for many other tasks related to passing stdin
lines as positional arguments. Take a look at the capital -P
option in xargs(1) for running several instances of a command in parallel.