LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How can I delete a directory and its files? (https://www.linuxquestions.org/questions/linux-general-1/how-can-i-delete-a-directory-and-its-files-29264/)

OrganicX 08-31-2002 02:54 PM

How can I delete a directory and its files?
 
I would like to delete a directory and all of its subdirectories and files in one command, can anyone tell me how to do this?

MartBrooks 08-31-2002 03:10 PM

rm -rf <directory>

Bert 08-31-2002 03:36 PM

When you are root, make sure that there is no space between your slash and the directory:

rm -rf / <directory>

or bad things will happen.

I'd use

rm -rf <TAB>

for a list of options.

ShawnD 08-31-2002 11:10 PM

great warning :)

what does the f mean? r means to include all subfolders right?

MasterC 08-31-2002 11:59 PM

Don't prompt, in other words, every file would go through and ask you if you are sure, this way, it will just remove it.

trickykid 09-01-2002 01:52 AM

Quote:

Originally posted by ShawnD
great warning :)

what does the f mean? r means to include all subfolders right?

r means recursive
f stands for force

tundra 09-01-2002 04:25 AM

check out the man pages for more information. at the prompt, type:
man rm


All times are GMT -5. The time now is 08:01 PM.