|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
problem of removing subdirectory of a directory
I find out cannot remove the directory that contain file and another subdirectory by using command
rmdir -f dir_name so, everytime i hv to clear out the content of directory in order to delete the directory. So, anyone can teach me how to solve this problem? thanks~ |
|
#2
|
|||
|
|||
|
rm has this option. See man rm for all options
rm -rf dir_name -r, -R, --recursive remove the contents of directories recursively -f, --force ignore nonexistent files, never prompt A warning: linux (and unix) are relentless, they do what you ask and don'y ask if you are sure! |
|
#3
|
|||
|
|||
|
druuna, thanks again~
I am a beginner of Unix OS, so i still not familiar with those command.. By the way, u r a very good tutor for me~ Have a nice day! |
|
#4
|
|||
|
|||
|
One small addition, You need to use "rm -rf" cautiously, if you tend to give "rm -rRf" * then the whole of the files from the root directory will be gets deleted. You better give rm -ri rather than rm -rf
-i option will ask for confirmation before deleting the files ![]()
__________________
Regards JK |
|
#5
|
|||
|
|||
|
It will ask for confirmation if you don't include -i or -f. If you know what you are doing, -f is a better solution especially if you have a lot of files, as it would be very annoying to have to say yes many times needlesly.
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > problem of removing subdirectory of a directory |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|