12 Practical Examples of Linux Xargs Command for Beginners


Aaron Kili


Xargs is a great command that reads streams of data from standard input, then generates and executes command lines; meaning it can take output of a command and passes it as argument of another command. $ find Pictures/tecmint/ -name *.png -type f -print0 xargs -0 tar -cvzf images.tar.gz 2. You can also convert muti-line output from ls command into single line using xargs as follows. Assuming you have a list of files, and you wish to know the number of lines/words/characters in each file in the list, you can use ls command and xargs for this purpose as follows. $ find .

Visit Link


Tags: