Last updated on December 1st, 2010 at 12:41 am
Cannot do mass delete ?
Cannot remove spam files ?
If you have too many files and with long file name. It is enable to delete using
rm -rf
or
rm *.xx
Here is the solution for the mass delete.
find . -name 'spam-file-*' | xargs rm
find . -name '*' | xargs rm
Because using find, it do find one by one and it is not put all the file together make the argument too long.
Your use of xargs can lead to nasty surprises because of the separator problem http://en.wikipedia.org/wiki/Xargs#The_separator_problem
GNU Parallel http://www.gnu.org/software/parallel/ does not have that
problem.
Watch the intro video for GNU Parallel: