The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Can not delete Directory Clevelaw AIX 9 05-21-2008 07:53 AM
Can't delete directory funksen SUN Solaris 4 03-09-2007 11:14 AM
delete a directory madmat UNIX for Dummies Questions & Answers 4 01-25-2007 08:14 AM
Can't delete a directory on HP-UX oradbus HP-UX 2 05-31-2005 12:32 PM
remove a nonempty directory babayeve UNIX for Dummies Questions & Answers 2 08-26-2002 08:34 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 04-30-2003
Registered User
 

Join Date: Apr 2002
Posts: 5
How to delete nonempty directory?

How to delete nonempty directory?
Thanks
Forum Sponsor
  #2  
Old 04-30-2003
oombera's Avatar
Registered User
 

Join Date: Aug 2002
Location: Cleveland, OH
Posts: 804
The directory has to be empty to use the rmdir command.. you can use rm yourdir/*; rmdir yourdir

Or you can use rm -r yourdir, but be careful. This is recursive, so all the files in yourdir will be deleted, then yourdir will be deleted, and if the directory yourdir was in is now empty, that will get deleted too. Read the rm man page for more info.

Last edited by oombera; 04-30-2003 at 10:32 PM.
  #3  
Old 05-01-2003
Registered User
 

Join Date: Jan 2002
Location: Arlington, TX
Posts: 4
I'd suggest using rm -r ./yourdir from one dir level higher just so you're sure that deleting the correct directory. rm -r isn't very forgiving.

If you don't want it to ask you for confirmations you can use rm -rf ./yourdir.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:03 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0