|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | 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.
|
| Sponsored Links | ||
|
|
#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 | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| check empty directory !!! | allah_waris45 | Shell Programming and Scripting | 2 | 06-01-2009 11:38 PM |
| check whether the directory is empty or not | KiranKumarKarre | Shell Programming and Scripting | 8 | 06-01-2009 05:06 AM |
| How do I tell if a directory is empty? | KenJackson | Shell Programming and Scripting | 6 | 12-31-2008 08:35 AM |
| How to empty all files in a directory | majormark | Shell Programming and Scripting | 9 | 07-21-2008 04:35 PM |
| Setting the right directory as non-empty | olimiles | Shell Programming and Scripting | 0 | 08-31-2006 10:31 AM |
|
|