If you have a folder that has a huge amount of files in it, and you want to delete everything, rm -rf * from within that folder should delete everything. However, if there are too many files in the folder for this command to handle, you’ll get an error like this:
/bin/rm: Argument list too long
To get around this, there are a couple of commands you can use:
ls | xargs rm
find . -maxdepth 1 -name "*" -print0 | xargs -0 rm
The 2nd command will only do the current directory you are in, and will not go into subfolders of that directory. Also, if you don’t want to delete everything, replace * with the type of file you want to delete. For example “*.php” will delete all php files.