14 October 2007

Deleting lots of files

If you are trying to delete a directory with lots of files in, rm will complain about to many files and refuse to delete. You can get round this with xargs:

find . -name "log-200709*.gz" -print0 | xargs -0 -t -r rm -f