LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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
 
LinkBack Search this Thread
Old 10-22-2006, 10:33 PM   #1
wlaw
Member
 
Registered: Jun 2004
Location: HK
Distribution: Ubuntu
Posts: 219

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


I would like to remove a non-empty directory. What is the command ?
Thank you !
 
Old 10-22-2006, 10:34 PM   #2
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 57
rm -ri <dirname>
 
Old 10-23-2006, 12:02 AM   #3
wlaw
Member
 
Registered: Jun 2004
Location: HK
Distribution: Ubuntu
Posts: 219

Original Poster
Rep: Reputation: 30
Thank you ! But it asks me if I want to del a particular file, so I have to press "y" and "enter" hundred times , any parameter to delete the direcotry without asking you to confirm ?

Thank you !
 
Old 10-23-2006, 12:03 AM   #4
wlaw
Member
 
Registered: Jun 2004
Location: HK
Distribution: Ubuntu
Posts: 219

Original Poster
Rep: Reputation: 30
Thank you ! But it asks me if I want to del a particular file, so I have to press "y" and "enter" hundred times , any parameter to delete the direcotry without asking you to confirm ?

Thank you !
 
Old 10-23-2006, 12:10 AM   #5
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,365

Rep: Reputation: Disabled
You can use "rm -rf directory/".
 
Old 10-23-2006, 09:46 AM   #6
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 59
rm -rf <directory> indeed does just that, but use it with care!
 
Old 10-23-2006, 10:02 AM   #7
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,843

Rep: Reputation: 122Reputation: 122
If you just want it to not ask you, omit the i from the original command posted
Code:
rm -r <dir_name>
 
  


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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are 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
safer alternative then rm -rf to remove non-empty directory? taiwf Linux - General 9 01-17-2006 08:24 PM
How do you remove a non empty directory aaronruss Linux - Newbie 3 06-05-2004 08:26 PM
RMDIR - how to remove a non-empty directory?? jacksmash Linux - Newbie 15 11-23-2003 12:51 PM


All times are GMT -5. The time now is 10:59 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration