deleting app from terminal
This isn't built into OSX, but a guy wrote a cli tool called trash that is cross platform and is intended as a safe alternative to rm. As it seems it should, it moves the target to the trash rather than deleting it immediately.

There is more information and instructions on how to install at the trash github page