HOWTO: Remove Directories in GNU/Linux
There are two options at your disposal to remove directories depending on whether you want to remove a single directory or an entire tree: rm -d or rmdir -p.
rm -d foo will remove the foo directory even if it is not empty. However, you must be root to use this command.
rmdir -p foo will remove the foo directory and ALL it’s subdirectories whether empty or not. You do not have to be root to do this, but you must own all the files and directories that will be effected.

















rm -r foo
or rm -rf foo
if you’d rather not be prompted for every file in the directory.
Thanks Dave! You’re right – I’d rather not be prompted
Not to mention, you don’t have to be root to use them.
You only need to be root for the rm -d command.
I did not know rm -d and rmdir -p
I use rm -rf all the time
RM-D AND RMDIR-P DONT WORK
THANKS ERIC
@Dog: Try rm -R that stands for remove directory recursively and it will remove the directory and its entire contents.
rmdir -p foo will _only_ remove foo and any subdirectories if they are _empty_ (http://www.linfo.org/rmdir.html). What is written above is incorrect.