You can use it to add items to the Trash as if it was done in the finder.

Edit: I just tried using rmtrash to delete and recover. It works exactly like deleting from finder. Files show up in the Trash, can be dragged out and emptied exactly the same. Been using it since '06 or so.

The rmtrash program moves files to the trash directory without using the system API, so the .DS_Store file won't be updated. Also, doesn't trigger the recycle sound.

The python script invokes a deprecated method on mountain lion which also doesn't trigger the recycle sound.

The ruby script works, but is sloooooow (like the python one).

So I wrote my own trash command implemented in the Nimrod programming language, so its fast and it triggers the trashcan sound in a background process. This means that typing the command and running it exits immediately as it doesn't need to wait for the sound to play. The con is you need to compile nimrod and then this program (no binary sorry!).

PS: To be honest the best implementation would be that of rmtrash using the official API I'm using from Nimrod, which is plain objective-c.