Stop accidental directory wipes with a safety net
Environment & Shell Customization (Aliases/Functions/.Bashrc)
Stop accidental directory wipes with a safety net
🧩 The Challenge
Everyone has had that moment where they hit enter on a recursive delete and immediately realized they were in the wrong path. My heart hits the floor every time I see that terminal prompt come back way too fast.
💡 The Fix
Turn your rm command into a prompt-first operation so you actually have to stop and think before the files vanish. It’s saved my bacon more times than I care to admit.
alias rm='rm -i'
⚙️ Why It Works
Setting the interactive flag by default forces the shell to ask for confirmation on every single file removal. It adds one extra keystroke to your workflow but acts as a massive speed bump against total disaster.
🚀 Pro-Tip: If you really need to blow something away without the prompt, just use /bin/rm instead of the alias.
Linux Tips & Tricks | © ngelinux.com | 10/29/2026
