Cannot delete oversized directories: /bin/rm: Argument list too long

If you’re trying to delete files inside a directory and the following command is not working

/bin/rm -rf *
/bin/rm: Argument list too long.

Try this instead:

find . -type f -delete

The find command is much quicker at listing files from a directory, and newer versions of “find” have -delete built in, which will allow you to remove files very quickly.