How to move files to trash from command line? I do a lot of terminal work, and today had the experience of typing

rm fileInQuestion.txt


Before finding out that I did actually need fileInQuestion.txt. If I'd deleted in the GUI then I would have just gotten it out of the Trash. I'd like to know if it's possible to overload 'rm' in the Terminal in such a way that it sends the file/files to the Trash on the way out.
The trash command line tool can be installed via brew install trash. 

It allows you to restore trashed files via command line or the Finder.