rm waterboy.txt

The rm command deletes files and directories. Here we remove the file waterboy.txt from the filesystem.

rm -r comedy

The -r is an option that modifies the behavior of the rm command. The -r stands for "recursive," and it's used to delete a directory and all of its child directories.

Be careful when you use rm! It deletes files and directories permanently. There isn't an undelete command, so once you delete a file or directory with rm, it's gone.


The commands we've covered so far are commonly used to view and change the filesystem.

Let's summarize what we've done so far. Click Next to continue.

Community Forums
Get help and ask questions in the Codecademy Forums
Report a Bug
If you see a bug or any other issue with this page, please report it here.