How can I delete a file or directory?

How can I delete a file or directory?

Use the “rm” (short for remove) command. For example, to remove a file called index.html:

rm index.html

You can use expressions which can match many files and go down all the subdirectories under a directory you are in with this. For instance:

rm -rf website

That would delete the directory “website” and all the files underneath of it. You have to be very careful with this! Imagine if you executed this command at in your main directory - you would lose all your work!!!