Deleting Folders with rm in linux

Friday, March 13, 2009 2:25
Posted in category Fedora, Linux

A 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! ;)

VN:F [1.8.8_1072]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.8_1072]
Rating: 0 (from 0 votes)
http://www.sanjeevshrestha.com.np/wp-content/plugins/sociofluid/images/digg_32.png http://www.sanjeevshrestha.com.np/wp-content/plugins/sociofluid/images/reddit_32.png http://www.sanjeevshrestha.com.np/wp-content/plugins/sociofluid/images/stumbleupon_32.png http://www.sanjeevshrestha.com.np/wp-content/plugins/sociofluid/images/delicious_32.png http://www.sanjeevshrestha.com.np/wp-content/plugins/sociofluid/images/blogmarks_32.png http://www.sanjeevshrestha.com.np/wp-content/plugins/sociofluid/images/google_32.png http://www.sanjeevshrestha.com.np/wp-content/plugins/sociofluid/images/myspace_32.png http://www.sanjeevshrestha.com.np/wp-content/plugins/sociofluid/images/facebook_32.png http://www.sanjeevshrestha.com.np/wp-content/plugins/sociofluid/images/yahoobuzz_32.png http://www.sanjeevshrestha.com.np/wp-content/plugins/sociofluid/images/twitter_32.png
You can leave a response, or trackback from your own site.

Leave a Reply