Copied from https://github.com/sindresorhus/guides/blob/master/how-not-to-rm-yourself.md
The rm
command is inherently dangerous and should not be used directly. It can at worst let you accidentally remove everything. Here's how you can protect you from yourself.
The trash
command-line tool will move stuff to the trash instead of permanently deleting it. You should not alias rm
to trash
as it will break external scripts relaying on the behavior of rm
. Instead use it directly: trash image.jpg
.