linux – Dangerous rm / command

Question:

Every time I write

rm /...

I'm afraid to press the enter after the slash. If anything, will confirmation be required or is it worth further fear?

Answer:

If you are afraid to press Enter , in this case it is better to add the -i flag

rm -i ./file.txt

In this case, a message confirming this action will be displayed before deleting.

And in order not to constantly enter this flag, just add alias to .bashrc

alias rm="rm -i"
Scroll to Top