A much faster way of deleting files – the “find” command has a “-delete” flag built right in!!
[root@localhost Desktop]# find . -type f -delete
Using this method, I was deleting files at a rate of about 2000 files/second.
You can also show the filenames as you’re deleting them:
[root@localhost Desktop]# find . -type d -print -delete
Or even show how many files will be deleted, then time how long it takes to delete them:
[root@localhost Desktop]# ls -1 | wc -l && time find . -type f -delete