Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-11-2004, 09:27 AM   #1
Registered: Oct 2004
Posts: 68

Rep: Reputation: 15
how can i delete an directory??

how can i use rm to delete an directory, i try to use option -d but still not work, also i try to use -r it works,however you have to comfirm everytime.
Old 12-11-2004, 09:39 AM   #2
Registered: Jul 2004
Location: Czech Republic - Roudnice nad Labem
Distribution: Debian
Posts: 253

Rep: Reputation: 34
recursion delete:
rm -rf dirname

empty dir delete:
rmdir dirname

comfirm everytime problem:
it's caused by -i option, probably you have alias rm='rm -i'
Old 12-11-2004, 09:47 AM   #3
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 75
be careful when using "rm -rf" coz it's irreversible.
Old 12-16-2004, 01:57 AM   #4
Registered: Oct 2004
Posts: 68

Original Poster
Rep: Reputation: 15
by the way, you said "rm -rf" coz it's irreversible. does that mean the other can reversible???? can you give me on detail how to do that
Old 12-16-2004, 02:15 AM   #5
Registered: Sep 2003
Location: Gorredijk, Netherlands
Distribution: Arch Linux
Posts: 400

Rep: Reputation: 30
Originally posted by vito_huang
by the way, you said "rm -rf" coz it's irreversible. does that mean the other can reversible???? can you give me on detail how to do that
They aren't. What he meant to say was that you can easily delete entire directories with everything in them by mistake. For instance, I once did a 'rm /etc -fr' instead of 'rm etc -fr' while root. No fun. But if you use a desktop environment like KDE or Gnome, they have trashcan thingies if you delete it with their file manager (Konqueror or Nautilus).


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
cant delete directory linuxmandrake Linux - Newbie 4 08-16-2005 11:14 AM
shell script: delete all directories named directory.# except directory.N brian0918 Programming 3 07-13-2005 06:54 PM
Delete directory mfo6463 Linux - Newbie 8 04-20-2004 05:04 PM
how to delete a directory master Linux - Newbie 2 03-27-2004 06:47 PM
How do you delete a directory? R4z0r Linux - Newbie 1 12-25-2002 11:16 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:58 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration