The rm command is used to delete files. ... rm -r will recursively delete a directory and all its contents (normally rm will not delete directories, while rmdir will only delete empty directories).