Kill all processes related to an application

If you want to do it by name:

killall firefox

If you want to kill a specific process, e.g. the first Firefox instance:

kill 38329

and if the process doesn't want to go, you can use:

kill -KILL 38261

There should be no way for a program to keep the OS from terminating it RIGHT NOW.

Update: To see a list of all available process names for the killall command, you can use:

ps -axco command | sort | uniq

You could do

kill `pgrep Xvfb` `pgrep Firefox`

You can add -f to search the entire command, in case it doesn't find it without the -f.

pgrep -f Firefox 

There is also pkill which takes the same input as pgrep

pkill Xvfb; pkill -f Firefox;