Site icon New Generation Enterprise Linux

Stop fat-fingering your most dangerous commands

Environment & Shell Customization (Aliases/Functions/.Bashrc)

Stop fat-fingering your most dangerous commands

🧩 The Challenge

We have all been there: you meant to type a harmless command but your pinky slips and you run something destructive like rm -rf / instead. I have spent way too many Friday nights restoring backups because I missed a slash or a period.

💡 The Fix

Just create an interactive override for the commands that keep you up at night. It forces you to actually type out the word yes before the shell lets you do something irreversible.

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

⚙️ Why It Works

Setting these aliases triggers the built-in safety prompt of the coreutils binaries whenever you try to overwrite or delete a file. Because shells prioritize aliases over system paths, your mistakes now trigger a pause instead of a catastrophe.

🚀 Pro-Tip: Put these in your .bashrc and then run source ~/.bashrc so you do not have to open a new terminal window to see it take effect.

Linux Tips & Tricks | © ngelinux.com | 7/16/2026

0 0 votes
Article Rating
Exit mobile version