Apr 04 2010

Deleting folder on Linux

Category: .opensourceAmit Bahree @ 7:31 pm

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/
Share
Similar posts to check out:
  • May 22, 2011 -- Hadoop in Azure (0)
    My dear friend Mario has finally got around to blogging and one of his latest posts shows, it is possible to run Hadoop (which if you are not familiar with, can be thought of as an open source version of Google’s MapReduce) in Azure. You need to setup a typical configuration of nodes (Name Nodes, Tracker and Slaves). Sure, there are a number of dependencies some you would expect, others not (e.g. Cygwin – cringe!; but hopefully that will go away with Hadoop 0.22). I wonder what overheard the C...
  • March 4, 2011 -- Twitter Trends (0)
    I was excited to find that Twitter had a JSON (Javascript Object Notation) endpoint for the current trending topics and decided to write a simple consumer which can read this and then spit it out in a simple console. And JSON being so simple and more or less “universal” meant that there are multiple implementations for .NET. Of course if you got lots of bandwidth you can roll out your own parser. I ended up using Json.NET, which in addition to being OpenSource is also one of the most robust u...
  • January 16, 2011 -- Opensource ZigBee stack? (1)
    I was planning on getting the Telegesis ETRX2USB and wanted to know if there are any open source (or shareware) open source ZigBee stacks that I can use with that? I also wanted to know if there is any opensource (or not too expensive), network management or network analyser for a ZigBee network? Essentially I want to be able to programatically view network and node information on the ZigBee network (e.g. S/N ratio, signal strength, etc.) - something similar to Ember's Insight Desktop which sho...

Tags:

3 Responses to “Deleting folder on Linux”

  1. Amit Bahree says:

    Lyle made a good point that this will follow symbolic links and delete those as well.

  2. Marc Jennings says:

    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.

  3. Amit Bahree says:

    Well if someone does end up deleting the root folder, they probably deserve the outcome.

Leave a Reply

*

Get Adobe Flash playerPlugin by wpburn.com wordpress themes