When there are too many files in the directory, using rm to delete files will report an error:

-bash: /bin/rm: Argument list too long

The solution is to use the following command:

ls | xargs -n 10 rm -fr ls

Xargs takes the output of ls in groups of 10 (space delimited) as a parameter to rm-rf. This means that all filenames in groups of 10 are deleted by rm-rf