Back to the learning path

xargs

xargs = extended arguments Command details
Step 1/1: Hand a list to a command

xargs reads names from standard input and passes them as arguments to a command. find … | xargs rm deletes everything find printed. When names may contain spaces, use find -print0 | xargs -0.

$ find . -name "*.tmp" | xargs rm
Advancedxargsfind
Find and delete temporary files
Use find to list every .tmp file here and in subdirectories, and pipe the list to xargs rm to delete them. Keep everything else.
bashNext lesson:help