Ever needed to delete a lot (and I mean several thousand) files from a directory in Linux? Then you may have encountered the “Argument list too long” error message which occurs when using “rm *” on the folder. This problem occurs because the list of files exceeds the 128K buffer which the kernel uses to pass the list of files to rm .
So how to defeat this problem?
Simple, use:
find . -name "*" -print | xargs rm
or, if you just want to delete the files starting “unwantedMail”, then use:
find . -name "unwantedMail*" -print | xargs rm
Be First to Comment