Yesterday I was trying to delete the content of a folder in my server, but when I typed:

$ rm -rf *

I get the following message:

rm – too many arguments

I stared blank to the screen.  “let me see how many files are there…”:

$ ls -l | wc -l

298839

Wow! so how can I delete all those files from the folder (???).  After a bit of research (thanks google!) I found what I needed:

$ find . -name '*' | xargs rm

The problem here is that “rm -rf  * ” will be translated into: “rm -rf file1 file2 file3 file4…. fileN” so… obviously too many arguments (298839 to be exact)…

Hope this help someone with the same problem.