Is there a significant disadvantage to aliasing rm to do something else?

The 'significant disadvantage' is that you'll get used to rm not being the big nasty, use with extreme care tool it is. This means if you ever (in your whole life, so pretty likely) use another computer not set up with this 'soft-rm' then you may use rm more carelessly, forgetting your safety net is not there.


To install trash-cli, just type in a console:

sudo apt-get install trash-cli

You can alias rm to trash-put if you like, they have a compatible syntax. It works nicely with the gnome trash, you can recover files deleted from the command line with nautilus or the trash applet and restore files trashed from nautilus from the command line using trash-list.

It will take care of different files names and remember the original location of the files too.


You can also try gvfs-trash, as ændrük notes in the comments. But trash-put has a couple of advantages over gvfs-trash:

1) It's not tied to gnome or gvfs. It will work even on a server without gnome or in other desktop environment. It achieves gnome compatibility because it uses the freedesktop trash spec, as gnome.

2) It tries to use the same format as rm, so it can be aliased to it. It will not fail the first time that a script tries to trash-put -Rf dir

The main advantage of gvfs-trash is that it's installed by default in Ubuntu.