Easy Way to Delete Folders in Linux

Started by Donald Darden, November 24, 2007, 11:08:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Donald Darden

The rm command can be used to delete files or folders, but balks at deleting folders with subfolders or files still within them.  However, if you check the switches that you can use with rm, you will find that -r allows it to recursively go through all the subfolders, and -f will force a delete for each item found.  So using rm -r -f and giving a folder name will get rid of it without fanfare.  You could also use the alias command to create a special instruction, say rmdir, to remember this for you.
  •