Apple added a new command to the command line utility in 10.8 that will allow you to kill any running process using wildcards. The command is pkill and builds on the existing kill command.
In the most basic way to use this command you’d type in the following: pkill application. You’d obviously replace the word application with the name of the application you’re trying to kill all associated process with. So if you type in Safari, every process associated with Safari will be terminated.
You can also use wild cards to expand the capabilities of the command. Let’s say you wanted to terminate all processes starting with the letter T, you’d type in the following: pkill T*
You can find even more flags for this command by viewing its manual within the command line utility. Just type in man pkill. I would recommend to all the average Mac users out there to stick with Activity Monitor for something like this, it will prevent you from accidentally terminating a group of processes that you may really need.