deleting a large number of files

I normally use the following to delete a large number of files residing in a directory as there is an upper limit rm can handle:

#find . -name * | xargs rm

Sometimes, if the number of file is so huge, the above might not 100 % workable. I have to give myself a backup option:

#find . -type f -exec rm {} \;

Not easy to remember the syntax but I need to memorize it for system administration.

No comments: