Deleting folder on Linux

If you are a newbie to Ubuntu like me (or any other Unix distro) and you tried deleting a folder which is not empty contains files or subdirectories then you get the annoying error “Directory not empty”.

To delete such a folder (from a terminal) use the rm -rf command. For example to delete a folder called amitbahree run the following:

rm -rf amitbahree/

Published by

Amit Bahree

This blog is my personal blog and while it does reflect my experiences in my professional life, this is just my thoughts. Most of the entries are technical though sometimes they can vary from the wacky to even political – however that is quite rare. Quite often, I have been asked what’s up with the “gibberish” and the funny title of the blog? Some people even going the extra step to say that, this is a virus that infected their system (ahem) well. [:D] It actually is quite simple, and if you have still not figured out then check out this link – whats in a name?

3 thoughts on “Deleting folder on Linux”

  1. WARNING! You might want to create an alias for ‘rm -rf /’ to something innocuous like ‘ls -l /’ – it is extremely rare that you’d want to actually delete your root folder. 🙂 Please don’t ask me how I know this, just trust me.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.