Method 1 – rm alias to mv to Trash

# in your aliases – e.g. ~/.bash_aliases – add this line

Method 2 – using trash-cli

trash-cli, in Python
trash-cli: (Open Source) Command line interface to the Linux trash can. Interoperates with all the desktop trash cans (KDE/Gnome/Xfce). Included in some Linux distributions. Proudly written in Python.
Written by italian developer Andrea Francia

https://github.com/andreafrancia

http://www.andreafrancia.it/code.html

# in your aliases – e.g. ~/.bash_aliases – add this line

trash-put trashes files and directories.
trash-empty empty the trashcan(s).
trash-list list trashed file.
restore-trash restore a trashed file.
trash-rm remove individual files from trash can.

References

http://askubuntu.com/questions/74269/intercepting-calls-to-rm-and-directing-deleted-files-to-trash-instead
http://www.webupd8.org/2010/02/make-rm-move-files-to-trash-instead-of.html

About Gugulethu Ncube

IT enthusiast getting things done.