Remove files or directories

rm [options] FILE

By default the rm command will not remove directories. Passing the flag -r (—recursive) will remove directories and their files recursively.

The related command rmdir can be used to remove empty directories.

Further reading:

  • man rm

cli