In Ubuntu how do I delete a directory and everything underneath it, including directories and their contents?

link|improve this question

65% accept rate
feedback

3 Answers

up vote 8 down vote accepted

What you are describing is called a recursive remove. To do this, open a shell and type:

rm -r /path/to/directory

link|improve this answer
brilliant. worked first time! – Zubair Feb 16 '10 at 15:40
...and don't run this as root unless you really need to, and if you do, be very careful, especially if you add the '-f' option. – Bryan Feb 16 '10 at 16:52
feedback
cd parent-directory_of_folder_to_be_blasted
rm -r the_folder_that_needs_to_be_blasted
link|improve this answer
feedback

rmdir: The rmdir command will delete an empty directory. To delete a directory and all of its contents recursively, use rm -r instead.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.