rmdir

Practice rmdir from memory. rmdir only removes empty directories - it errors if anything is inside. Use rm -r when you actually need to delete a pop

Remove an empty directory.

rmdir dirname

rmdir only removes empty directories - it errors if anything is inside. Use rm -r when you actually need to delete a populated tree. Caution note: check the target, scope, and preview or dry-run options before using this on a real system.

Safety: Preview paths and redirections before changing files or streams.

Build the habit: BashDrill drills rmdir and the rest of the Bash workflow until the safe first move is automatic. Try a Bash drill.