How to delete big files, or many files, in linux

How to delete big files, or many files, in linux


I have stumble upon this problem before where there is so many log files auto generated. it becomes trouble when the total of files is big and the filename is different.
example error is 'argument list too long'.

when simple command like "rm -rf *" is not working, u can use below command.

find . -type f -print0 | xargs -0 rm

in this command, we will find all file in the directory, and remove ot.

another command if its still not working.

find . -type f -exec rm {} \;

Comments