linux xargs code example
Example 1: xargs parameter
Just use the pipe output of a command as input with xargs as follows:
ls | xargs -I {} echo "File " {} "stored in current folder" > files_list
Command above gets files in a folder and save echo output into a file
Example 2: xargs in linux
$ find Pictures/tecmint/ -name "*.png" -type f -print0 | xargs -0 tar -cvzf images.tar.gz
Example 3: xargs example
echo 'one two three' | xargs mkdir
ls
one two three