# Deleting Safely: rm and rmdir

rm deletes files for good, with no trash can to undo it, so you check the same names with ls first, let rm -i ask about each file, and use rmdir for empty folders and rm -r only after looking inside.

![Cheat sheet for the lesson Deleting Safely: rm and rmdir: rm deletes files for good, with no trash can to undo it, so you check the same names with ls first, let rm -i ask about each file, and use rmdir for empty folders and rm -r only after looking inside.](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/3f78364eb15140ce903accf3a0a065d4.webp)

- Category: Bash
- Level: Novice
- Tags: linux, rm, rmdir, unix, wildcard
- Updated: November 10, 2026

Source: https://www.ask-codey.com/cheat-sheets/bash-deleting-safely-cheat-sheet
