Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete a folder including contents

Status
Not open for further replies.

ashley75

Technical User
Oct 4, 2002
94
US
I know this is too easy for alot of people in here. But I like to find out what is the command to delete a folder including the contents???

thanks
 
if you're deleting a folder with a lot of files inside it, you may want to use the -f (force) option to disable prompting, so your command would be:

rm -rf <foldername>

rm = remove

-r, -R, --recursive
remove the contents of directories _ recursively


-f, --force
ignore nonexistent files, never prompt

and from the last post:

-v, --verbose
explain what is being done

(this was taken directly from the man page &quot;man rm&quot;)

--cb
 
But be careful when using any combination of rm -r that you're where you think you are in the system. I think we've all encountered this phenomenon before! Always issue a pwd before the rm, just to be sure. Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top