`
If you find these tutorials useful, Please consider making a donation.

TheFrugalComputerLinuxLogo.png
TheFrugalComputerGuy.png
Linux Command Line 14
xargs







Linux Command Line (45) xargs

xargs is short for execute as argument and is shown in the video by echoing out a filename and piping that in to wc. Without xargs the filename information is processed by the wc command, with xargs the file itself is processed by the wc command.

The number of fields per line can be changed with the -n option and xargs uses -t for verbose. The default input delimiter is white-space, but that can be changed.

The video then shows how to use xargs to create a text file for every item in the grocerylist.txt file. We then use xargs with grep to change the group of only the test files that start with the letter "s" and then use xargs with find to change the permissions of files that start with the letter p.

xargs is then used to add some text to filenames.