Tue 4 Sep 2007
Ever try to delete the contents of a large directory in nix type operating system? If you have many files you will get an error like “list to long” or something like that. This happens to some of my directories I use to cache pages, sometimes I want to clear them out manually.

So now what?
The easiest and quickest solution is to remove the entire directory with a command like this. Now, before you do it, you need to realize that you will have to recreate the directory when it’s done, so take note of the permissions you have on the directory first.
rm -rf directoryname

You can see the directory is now gone “No such file or directory”. Yes, that is exactly what I wanted!