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 04-21-2003, 09:22 AM   #1
sadiboyz
LQ Newbie
 
Registered: Apr 2003
Location: wollongong, australia
Distribution: red hat
Posts: 28

Rep: Reputation: 15
deleting non-empty directory


Howdy

how to remove/delete a directory which is not empty, without first emptying the directory. like i mean in one go, with a single command.
Ciao
 
Old 04-21-2003, 09:31 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
rm -rf /directory

Be careful, this can be dangerous, if you accidently leave a space between the / and name of the directory, you will delete everything on your system.

Also a search would have found this as its asked all the time with replies.
 
Old 04-21-2003, 09:29 PM   #3
Texicle
Member
 
Registered: Oct 2002
Location: Northern Ontario, Canada
Distribution: Slackware 10.0
Posts: 789

Rep: Reputation: 30
I think you'd be better off typing the following:

man rmdir

You should take not of the --ignore-on-non-empty or whatever the option is (I'm not at my Slackbox to give you the proper option, but if you read the man page, you'll find what you're looking for--and it's harder to delete your whole system with the rmdir command).

Hope this helps.
 
  


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
Deleting empty line at end of text file in BASH human2.0 Linux - General 8 04-01-2009 02:44 AM
"WARNING: Circular directory structure" error when deleting directory pistonbrew Linux - Software 5 02-03-2005 06:05 AM
ProFTPD - deleting non-empty directories? orange400 Linux - Software 1 05-28-2004 03:36 AM
Mounting a non-empty directory MasterBean Linux - General 1 07-12-2001 10:34 PM

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

All times are GMT -5. The time now is 09:41 PM.

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