Deleting files to the trash in the shell

Somebody on Ubuntu brainstorm wanted to have rm throw files into the trash. This is not really a good idea, because it will probably end up confusing you when you start using SSH to other machines or try the same thing at your neighbors new Ubuntu installation.

The solution is the following:
1) Open a terminal
2) Run the command:

echo alias del=gvfs-trash >> ~/.bashrc

You can also do this for the default "rm", using rm instead of "del" in the above command, but as mentioned before, Idon't advise it. If you now use del instead of rm, you will through things into your trash.