Delete large number of files with find command

Trying to delete a very large number of files at one time will probably run into this error:
Argument list too long.

The problem is that when you type something like rm -rf *, the * is replaced with a list of every matching file, like rm -rf file1 file2 file3 file4 and so on. There is a reletively small buffer of memory allocated to storing this list of arguments and if it is filled up, the shell will not execute the program.

To get around this problem, we can use the find command to find every file and pass them one-by-one to the rm command like this:
find . -type f -exec rm -v {} \;

The problem is that if is needed to delete milion of files this will take way too long.

A faster way of deleting files is the -delete flag:
find . -type f -delete

To show the filenames while deleting them:
find . -type f -print -delete

To show how many files will be deleted, then time how long it takes to delete them:
ls -1 | wc -l && time find . -type f -delete