LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-30-2003, 11:37 PM   #1
KaktusKnight
Member
 
Registered: Dec 2002
Location: Gothenburg, Sweden
Distribution: Suse2.7, Mandrake 8, Redhat ?, Suse 8.2
Posts: 71

Rep: Reputation: 15
remove directory??


I am using SuSe 7.2, 8.1 and 8.2 and I have a little problem. What is the command for deleting folders with files inside? I have tried rmdir in various ways but it is not working? Anyone that knows?

Thanks in advance!!
 
Old 03-30-2003, 11:39 PM   #2
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
rm -rf /directory/you/want/to/remove

Carefull though! rm -rf is the most dangerous of all commands.
 
Old 03-30-2003, 11:58 PM   #3
snocked
Member
 
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482

Rep: Reputation: 30
rmdir only works if the dir is empty, so like Crashed_Again said, use rm with recursive and force switches.
 
Old 03-31-2003, 12:42 AM   #4
KaktusKnight
Member
 
Registered: Dec 2002
Location: Gothenburg, Sweden
Distribution: Suse2.7, Mandrake 8, Redhat ?, Suse 8.2
Posts: 71

Original Poster
Rep: Reputation: 15
Thanks a lot!! To solve the problem temporarily I had to put all the directories I did not need anymore in a special directory, just to get rid of them.. Thanks again!!
 
Old 05-30-2003, 08:30 PM   #5
buknoy
LQ Newbie
 
Registered: May 2003
Posts: 2

Rep: Reputation: 0
Thumbs up

Crashed_Again was very helpful in many ways. I am using Redhat 8.3 and for some reason, "rm -df *" and "rm -fr *" does not work in my system. All I could get are the "Cannot Unlink" error messages.
 
Old 05-31-2003, 12:20 PM   #6
Electboy
Member
 
Registered: May 2003
Location: VietNam
Distribution: RedHat 9.0
Posts: 79

Rep: Reputation: 15
Quote:
rm -rf is the most dangerous of all commands.
Why is it the most dangerous?
 
Old 05-31-2003, 12:33 PM   #7
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 271Reputation: 271Reputation: 271
Quote:
Originally posted by Electboy
Why is it the most dangerous?
Say your logged in as root and you type this:

rm -rf / home/user1/example-file

Notice the space after / and home? If you accidently typed that command and accidently made a space after the / and home, you would delete everything on your system. And it would be gone. That's why its dangerous.
 
Old 05-31-2003, 12:38 PM   #8
Electboy
Member
 
Registered: May 2003
Location: VietNam
Distribution: RedHat 9.0
Posts: 79

Rep: Reputation: 15
Thanks trickykid
 
Old 05-31-2003, 01:26 PM   #9
chrismiceli
Member
 
Registered: Aug 2002
Posts: 349

Rep: Reputation: 31
yeah, once i accidentally made a file name "/" with vi (:wq/) and went to remove it like this
rm / -fr
it should have been this
rm .\/ -f
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rm: cannot remove directory `ff': Directory not empty blancs Linux - General 17 08-29-2011 01:47 PM
Remove a Directory browser Linux - Newbie 8 08-11-2005 08:28 AM
help how to remove directory blackman890 Mandriva 6 11-09-2004 06:06 PM
how to remove a directory Meatball1337 Linux - Software 2 10-10-2004 09:39 AM
Remove a Directory RedHatMN Linux - Newbie 2 12-05-2001 02:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:54 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