deleting app from terminal

from the /Applications folder, I can launch apps on my Mac using the open command in the terminal like this

open xcode.app
open firefox.app

Is there a way to delete apps from the terminal? This question/answer doesn't provide the answer to this question


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


It is not recommended to use the rm method since you can mistakenly remove wrong file and it is no longer in trash.

But if you must:

Instructions

Type sudo rm –f (with a space after the f and not including the quotes) to delete a file.

Type sudo rm –rf to delete a folder.

Drag and drop the files you wish to delete onto the open Terminal window. The files you drop on the Terminal window will be deleted. You can drag and drop multiple files and folders onto the Terminal window.

Read more: http://www.ehow.com/how_4530950_delete-terminal-mac-os-x.html#ixzz324fT3H5z

YOU HAVE BEEN WARNED !