LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 12-11-2004, 09:27 AM   #1
vito_huang
Member
 
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
Vookimedlo
Member
 
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
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
be careful when using "rm -rf" coz it's irreversible.
 
Old 12-16-2004, 01:57 AM   #4
vito_huang
Member
 
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
Haiyadragon
Member
 
Registered: Sep 2003
Location: Gorredijk, Netherlands
Distribution: Arch Linux
Posts: 400

Rep: Reputation: 30
Quote:
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).
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:30 AM.

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