I recently installed Ubuntu and find that when I delete things in terminal using
rm file
there is no warning asking me to confirm the step. I did not use the -f flag. It feels vulnerable to accidental deletion in this way. I searched online and didn't find the reason for this. How can I turn on the warning?
Put alias rm='rm -i' in your ~/.bash_rc or rc file of your shell. Then
source ~/.bash_rc.
It will start asking for confirmation and whenever you don't want this. Use one of the following
$\rm file
$command rm file
\ escapes the alias and I like \ better due to it's lesser typing
This explanation assumes that you are using bash. The name for rc file may differs based on your shell
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With