Linux “Argument list too long”: Beyond Arguments and Limitations

"Argument list too long": Beyond Arguments and LimitationsDeleting large number of files on linux

Are you trying to delete a very large number of files at one time, you will probably run into this error:
/bin/rm: Argument list too long.

"Argument list too long": Beyond Arguments and Limitations

Deleting large number of files on Linux

To Solve this using a faster way of deleting files – the “find” command has a “-delete” flag built right in! use this:
find . -type f -delete

or this to show the filenames as you’re deleting them:
find . -type d -print -delete