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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-30-2003, 11:37 PM
|
#1
|
Member
Registered: Dec 2002
Location: Gothenburg, Sweden
Distribution: Suse2.7, Mandrake 8, Redhat ?, Suse 8.2
Posts: 71
Rep:
|
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!!
|
|
|
03-30-2003, 11:39 PM
|
#2
|
Senior Member
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503
Rep:
|
rm -rf /directory/you/want/to/remove
Carefull though! rm -rf is the most dangerous of all commands.
|
|
|
03-30-2003, 11:58 PM
|
#3
|
Member
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482
Rep:
|
rmdir only works if the dir is empty, so like Crashed_Again said, use rm with recursive and force switches.
|
|
|
03-31-2003, 12:42 AM
|
#4
|
Member
Registered: Dec 2002
Location: Gothenburg, Sweden
Distribution: Suse2.7, Mandrake 8, Redhat ?, Suse 8.2
Posts: 71
Original Poster
Rep:
|
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!! 
|
|
|
05-30-2003, 08:30 PM
|
#5
|
LQ Newbie
Registered: May 2003
Posts: 2
Rep:
|
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. 
|
|
|
05-31-2003, 12:20 PM
|
#6
|
Member
Registered: May 2003
Location: VietNam
Distribution: RedHat 9.0
Posts: 79
Rep:
|
Quote:
rm -rf is the most dangerous of all commands.
|
Why is it the most dangerous?
|
|
|
05-31-2003, 12:33 PM
|
#7
|
LQ Guru
Registered: Jan 2001
Posts: 24,149
|
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.
|
|
|
05-31-2003, 12:38 PM
|
#8
|
Member
Registered: May 2003
Location: VietNam
Distribution: RedHat 9.0
Posts: 79
Rep:
|
Thanks trickykid 
|
|
|
05-31-2003, 01:26 PM
|
#9
|
Member
Registered: Aug 2002
Posts: 349
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 01:54 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|