Ubuntu - xargs - Using xargs with find

Used to search for specific files and perform further processing on those files using xargs.


Syntax

find /home/peter -name "*.txt" -type f -print0 | xargs rm -f

NOTE: When using xargs with find, it does not include files that contain special characters in their names.

  • It is advisable to use the find -print0 option to include such files.