If you want a customized rm
, don't call it rm
but a name of yours, myrm
, delete
or whatever.
The rm='rm -i'
alias is an horror because after a while using it, you will expect rm
to prompt you by default before removing files. Of course, one day you'll run it with an account that hasn't that alias set and before you understand what's going on, it is too late.
In any case, a good way to be prepared for file loss or corruption is doing backups.
A fast alternative that will protect you against accidental file deletion or overwriting is using a file system that support unlimited snapshots like ZFS. If frequent snapshots are done automatically, you can recover the files at the state they were during the last snapshot before the incident.
rm
is a dangerous command requiring an alias for safety. By using ther
andf
options, you're telling the shell I know this is dangerous, and I've thought carefully about it, and it's _really_ what I want to do. If you don't use those options, you can't delete your entire home folder with it.rm
you will get used to that alias. Then one day, you'll be on a system where the alias doesn't exist, and you'll do the wrong thing when you are least expecting it. And it probably won't be your system.rm
torm -i
.