Related

RM Command

To delete a file or folder, one would simply use rm in the following manner:

rm PATH-TO-FILE-OR-DIRECTORY

Depending on permissions, you may need to write sudo in front of rm.

sudo rm /var/www/mysite/index.html

You can also navigate to the directory before deleting the file using the cd command.

cd /var/www/mysite
sudo rm /var/www/mysite/index.html

To move back to your home directory, do something like this:

cd /home/MyUser

The command is useful when you are writing scripts, and when managing a computer or server remotely. Mostly since you typically do not have access to a GUI in those cases. Other than this, it is mostly personal preference. Some users find it faster to use the terminal, while others find it difficult to remember commands. Etc.

Using the terminal vs your file manager

Alternatively you may also delete files and folders with your favorite file manager. Nemo makes it easy, as it has the option to "Open as Root" when right clicking on a directory. But you could also launch Nautilus as root.

Many Linux users prefer to use the terminal, and some are (irrationally) against using a GUI. However,
any modern OS should be expected to offer GUIs, both for productivity, and to make things easier for their users. With the terminal, users often have to learn, and memorize complex commands – something we can not expect users to do.