rm to move files to trash is like weed. It is common and pleasuring but can be bad for you in the future. ;)
You really need control yourself when using
Don't use rm
Imagine, you get used to rm moving to trash and make a habit of it. Sure, your system is safe but when you log into a friend's (or your wife's or your boss') notebook and have to delete something? You'll be actually using the real
rm - deleting those files forever. It's a bad habit, and you need to know that.
So instead, install
rmtrash and make a habit of using it:
$ brew install rmtrash
$ alias trash="rmtrash"
$ alias del="rmtrash" # del / trash are shorter than rmtrash
Correcting bad habits
Another thing you can do to force yourself to use
rmtrash instead of
rm is alias it to a custom message in your
.zshrc. (As Caleb points out, this is a bad idea, I know this can break other programs using
rm but we're only doing this temporarily)
alias rm="echo Use 'del', or the full path i.e. '/bin/rm'"
So, whenever you use
rm, you'll be prompted to either use
/bin/rm. Remember, this is only temporary, after a while you should remove the alias.
Never ever, do something like this:
cd /tmp; rm -rf *
Because if there's even a simple typo, you could screw up big time.
$ cd /tnp; rm -rf *
sh: cd: /tnp: No such file or directory
Pop Quiz: In what directory will the