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 11-21-2003, 01:49 PM   #1
jacksmash
Member
 
Registered: Nov 2003
Location: Ontario, Canada
Distribution: Ubuntu
Posts: 269

Rep: Reputation: 30
RMDIR - how to remove a non-empty directory??


How do you remove a non-empty directory without having to manually delete all of its contents??
 
Old 11-21-2003, 01:52 PM   #2
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
rm -R /path/to/directory
rm -rf /path/to/directory

Use with caution.......
 
1 members found this post helpful.
Old 11-21-2003, 02:49 PM   #3
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 18.04-14.04, Scientific Linux 6.3-6.4, Android-x86, Pretty much all distros at one point...
Posts: 1,802

Rep: Reputation: 157Reputation: 157
You always CAN use a gui tool like konqueror to do that, you know. You don't have to do EVERYTHING by the command line.
 
Old 11-21-2003, 02:52 PM   #4
Brain Drop
Member
 
Registered: Feb 2003
Location: just outside reality
Distribution: balanced
Posts: 752

Rep: Reputation: 35
Quote:
Originally posted by JaseP
You always CAN use a gui tool like konqueror to do that, you know. You don't have to do EVERYTHING by the command line.
or an in between like File Runner. use it. love it.
 
Old 11-21-2003, 02:52 PM   #5
jacksmash
Member
 
Registered: Nov 2003
Location: Ontario, Canada
Distribution: Ubuntu
Posts: 269

Original Poster
Rep: Reputation: 30
what's wrong with using the command line??
 
Old 11-21-2003, 03:11 PM   #6
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
Quote:
Originally posted by jacksmash
what's wrong with using the command line??
It always works and gives error messages if something is wrong?

No, wait! That's what is right with the command line...
 
Old 11-22-2003, 11:22 AM   #7
titanium_geek
Senior Member
 
Registered: May 2002
Location: Horsham Australia
Distribution: elementary os 5.1
Posts: 2,479

Rep: Reputation: 50
Be EXTREMELY careful.
This is how (not that specific command) that I messed up my intire Linux install. had to reformat both hdd's. No backup did I have either.
sigh...
be warned!!

titanium_geek
 
Old 11-22-2003, 11:30 AM   #8
jacksmash
Member
 
Registered: Nov 2003
Location: Ontario, Canada
Distribution: Ubuntu
Posts: 269

Original Poster
Rep: Reputation: 30
ok, thanks!!
 
Old 11-22-2003, 02:41 PM   #9
Brain Drop
Member
 
Registered: Feb 2003
Location: just outside reality
Distribution: balanced
Posts: 752

Rep: Reputation: 35
Quote:
Originally posted by jacksmash
ok, thanks!!
just had to say jacksmash: your sig sounds like my enitre csc120 class-=myself
 
Old 11-23-2003, 08:44 AM   #10
Sir Gawain
Member
 
Registered: Sep 2003
Location: Illinois, United States
Distribution: Slackware 9.1
Posts: 37

Rep: Reputation: 15
#rm -rf / oops!
 
Old 11-23-2003, 11:54 AM   #11
jacksmash
Member
 
Registered: Nov 2003
Location: Ontario, Canada
Distribution: Ubuntu
Posts: 269

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by Sir Gawain
#rm -rf / oops!
Like I'm going to try that!!
 
Old 11-23-2003, 12:03 PM   #12
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
So you think. You actually may do that unintentionally. Several people have thought that, but did it anyhow.

When in root, sit on your hands a lot and resist the urge to hit enter. Read what you typed several times because once you hit that enter key, the commands get carried out as long as there is enough system left to perform them.
 
Old 11-23-2003, 12:39 PM   #13
jacksmash
Member
 
Registered: Nov 2003
Location: Ontario, Canada
Distribution: Ubuntu
Posts: 269

Original Poster
Rep: Reputation: 30
Good tip. Thanks!
 
Old 11-23-2003, 12:43 PM   #14
vasudevadas
Member
 
Registered: Jul 2003
Location: Bedford, UK
Distribution: Slackware 11.0, LFS 6.1
Posts: 519

Rep: Reputation: 30
If it doesn't work, stick a -f in there. That's what I usually do! (In my mind -f stands for "just f***ing do it)!
 
Old 11-23-2003, 12:47 PM   #15
jacksmash
Member
 
Registered: Nov 2003
Location: Ontario, Canada
Distribution: Ubuntu
Posts: 269

Original Poster
Rep: Reputation: 30
Language language!
 
  


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
rm: cannot remove directory `ff': Directory not empty blancs Linux - General 17 08-29-2011 01:47 PM
remove a non empty directory in shell acidjuice Slackware 10 06-28-2011 12:02 PM
rmdir command does not remove directory with space tsaravan Linux - Newbie 3 08-16-2005 08:45 AM
Perl does not want rmdir an empty directory keefaz Programming 6 05-05-2005 01:59 AM
How do you remove a non empty directory aaronruss Linux - Newbie 3 06-05-2004 08:26 PM

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

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