xargs - build and execute command lines from standard input


To combine xargs with find
$ find [location] -name "[search-term]" -type f | xargs [command]
$ find /home -name *.txt -type f | xargs rm -f

To combine xargs with grep
$ find . -name '[search-term]' | xargs grep '[string-to-find-in-files]'
$ find / -name *.txt | xargs grep 'sample'

To read Items From File
$ xargs -a [filename]
$ xargs -a example.txt

To see the commands executed by xargs in standard output
$ [command-providing-input] | xargs -t [command]
$ echo "folder1 folder2 folder3" | xargs -t mkdir

To List All Linux User Accounts on the System
$ echo "file.txt" | xargs -p rm

To List Number of Lines/Words/Characters in Each File
$ ls | xargs wc



regards,
T.Dhanasekar