process input from command, for the use in anther command as parameters.
will work as echo if no extra instructions is included.
<command> | xargs -n1
will divided the input to one parameter per handling. similarly if we use:
<command> | xargs -n2
every two parameters will used per command handling.
<command1> | xargs <command2>
will concatenated the standard output of command1 to command2, and then will run the result concatenated command.
For example if we want to tar all visible file (file that don’t have . prefix) in the current directory (we assume no directory in the current directory):
ls | xargs tar cvzf helloworld.tgz
This will tar and gzip all the fill and directory in the current directory into helloworld.tgz