Deleting Folders with rm in linux
Friday, March 13, 2009 2:25A newbie in linux with some basic knowledge of linux commands usually get stuck deleting folders in linux terminal. I happen to be newbie and had to face problems when deleting folders in linux earlier. I use fedora.
Usually there are folders with many deep rooted sub folders which you might need to delete in one command call. I faced the similar problem. I knew there is a command rm. I used it but alas it kept on prompting “cannot remove ‘—’ : Is a directory.”
So here is a way to use rm to delete all folders and its subfolders. You can delete folders and its subfolders with -rf switch in rm command. i.e.
$ rm -rf path/to/folder
It will remove all the folders and its sub folders in the path. A Little Explanation:
rm = remove
-r = remove recursively
-f = forcefully remove
Try now!
















