I'll copy my SO answermy SO answer here:
In Ubuntu the trash files are kept in ~/.local/share/Trash/files
There is a trash command line interface that you can use. To install do:
sudo apt-get install trash-cli
Then, to trash something do:
trash-put myfile.txt