Unix question: how do i...

spanky

Lifer
Jun 19, 2001
25,716
4
81
hello all,

i have a question, which i hope has a fairly simple solution. is there a Unix command that is similar to the "deltree" command from windows? basically, what i want to do is to be able to delete a directory, which also has other files and/or directories within it. when i use the "rm" command, it tells me that the dir is not empty. is there an easy way to just blow it away in a single command? i would appreciate any suggestion you might have. thank you.


-spanky
 

agnitrate

Diamond Member
Jul 2, 2001
3,761
1
0
rm -R dir_name_here. So an example of what you DONT want to do: rm -r /
don't break your box now :)

silver
 

spanky

Lifer
Jun 19, 2001
25,716
4
81


<< rm -R dir_name_here. So an example of what you DONT want to do: rm -r /
don't break your box now :)

silver
>>




so "rm -r /" is the equivalent of "format c:" eh? thanx for your help :)

10 for u!
 

Gandalf

Member
Oct 21, 1999
72
0
0
If you're sure you're deleting the right directory, you may want to say "rm -rf <dirname>" to avoid possible interrogations about deleting some of the files. On some unix systems the default configuration for "rm" is to ask permission before deleting any file. In this case -f (force) is really needed unless you want to press "y" a hundred times.
 

spanky

Lifer
Jun 19, 2001
25,716
4
81


<< If you're sure you're deleting the right directory, you may want to say "rm -rf <dirname>" to avoid possible interrogations about deleting some of the files. On some unix systems the default configuration for "rm" is to ask permission before deleting any file. In this case -f (force) is really needed unless you want to press "y" a hundred times. >>



thank you Gandalf :)