LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Remove directory and sub directories (http://www.linuxquestions.org/questions/linux-newbie-8/remove-directory-and-sub-directories-329084/)

newuser455 06-01-2005 12:07 AM

Remove directory and sub directories
 
How can I remove a directory and sub directory?

This is what happens when I use rm -r

Code:

[root@server main]# rm -r dir
rm: descend into directory `dir/ASP'? y
rm: descend into directory `dir/CGI'?

How can I force all of the directories to be deleted?

cash_05 06-01-2005 12:13 AM

user rm -fr

type rm --help for more detail, f means force i think, so the system wont ask whether to delete or not.

cheers

Mega Man X 06-01-2005 12:14 AM

Try "rm -rf <directory>". Using the f flag you won't be asked if you are sure about deleting the directory/sub directories. Use it carefully ;)

Regards!

newuser455 06-01-2005 12:16 AM

Thanks. I've been just typing "y" for every one. lol. One thing I just never learned in my 1 1/2 years with linux so far...

reddazz 06-01-2005 12:27 AM

Quote:

Originally posted by newuser455
Thanks. I've been just typing "y" for every one. lol. One thing I just never learned in my 1 1/2 years with linux so far...
Its probably good you never learnt it as a newbie. Its a very good command, but also very dangerous.

newuser455 06-01-2005 12:31 AM

No, I regret that I never learned it... what I have been using is just as bad. Once I thought my website was backed up, so I spent a few minuted saying "y" to everything, later to find out that I did not have it backed up... I think that tought me a good enough lesson;) Yeah, I'm pretty careful now.

P.S. Yay, this is my 100th post. lol


All times are GMT -5. The time now is 07:56 AM.