Click to See Complete Forum and Search --> : Debian question: Can you delete a directory without emptying it first?


BK1
12-22-2000, 07:18 PM
I mistakenly downloaded Netscape Communicator, without reading that far into the Learning Debian manual to find the correct way to do it. Now I would like to remove the Communicator I downloaded and placed into my home directory. But when I rmdir (communicator string) it says the directory is not empty and will not remove it. It seems to me that the manual is saying I should be able to enter rmdir -r (communicator string) to remove it. But when I issue that command it refers me to rmdir --help and says the -r option doesn't exist.
What can I do?
Any help will be appreciated.
Thank,

------------------
The Hills of Defeat are covered with the bleached bones of those, who with victory in sight, paused to rest. Hurry up everytime you think about it.

teeitup
12-22-2000, 08:23 PM
I do it this way

rm -R -f dir_name

The -R recurses through the directory structure.
The -f automatically answers yes to confirmations.



------------------
Don't take life to seriously, You'll never get out alive!
-Bugs Bunny-

mdwatts
12-22-2000, 09:52 PM
Be very careful though. A very dangerous command.

crazyox2
12-22-2000, 10:30 PM
rm -rf / should do the trick.


*JUST KIDDING*

DMR
12-22-2000, 11:05 PM
BK1,

teeitup is right. the "rmdir" command only deletes empty directories, "rm -rf" will delete all files and subdirectories, without prompting for confirmation, and then delete the main directory.

Take mdwatts advice, though. If you issue this command incorrectly, it will go merrily on its way, deleting everthing you told it to. Try crazyox2's suggestion, you'll see what I mean. (*really* just kidding, don't do it!).

BK1
12-23-2000, 05:08 PM
Thanks guys I got it working, re-downloaded and am back on now.
I didn't follow CrazyOX2's suggestion, thankfully (Insane Cow...just kidding).
Again thanks,