|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
rmdir a non-empty directory.
hi, i understand that rmdir will only remove direcotry when it is empty but are there options which will also remove non-empty directories? i went to man rmdir but only find the option -p? i am on solaris. thanks
|
| Sponsored Links | ||
|
|
|
#2
|
||||
|
||||
|
You could use rm -R instead. This will remove the directory as well as any files and subdirectories as long as they are not in use. Be carefull though, make sure you specify the correct directory or you can remove a lot of stuff quickly.
|
|
#3
|
||||
|
||||
|
Re: rmdir a non-empty directory.
You could also do a:
rm -rf <target> The -r and -R (see previous reply from TioTony) parameter are the same and will make it recursively travel down any subdirectory it finds. The -f makes sure you are not prompted for confirmation (handy if there are lots of files and directories inside the target-directory). Same warning applies here... Be careful when using this. Re-read your commandline and make sure you're in the right directory! Most of the time, when using a powerful command like this, I use the full path + directoryname, just to be sure. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| remove empty directory | sirrtuan | Shell Programming and Scripting | 7 | 04-09-2009 12:41 AM |
| Script to remove all empty files within the directory structure? | cat123 | Shell Programming and Scripting | 5 | 06-05-2008 09:01 AM |
| deleting empty files in a directory | berlin_germany | Shell Programming and Scripting | 5 | 01-26-2007 02:47 PM |
| Setting the right directory as non-empty | olimiles | Shell Programming and Scripting | 0 | 08-31-2006 10:31 AM |
| How to ufsrestore to a different machine, empty directory | joekerr | Solaris | 1 | 07-22-2005 10:46 AM |