How do I delete a folder

I have created a folder in my file system called "opt". It contains two other folders. How do I delete it with signing in as a root user? Thanks


Open terminal - Type this command and hit enter key

sudo gksu nautilus

Now, enter your password, After you can go to "opt" directory and delete it


rmdir will not work here as it will only remove empty directories

use rm with some additional flags

rm -r will recurse and delete everything in the folder

rm -f will force the removal of a directory. rm is not for removing directories

put these together and your command should be rm -rf /path/to/opt

Depending on the permissions of the folder you might need to use sudo rm -rf /path/to/opt

Check out man rm to get some extra info.