How to gently kill Firefox process on Linux/OS X How to gently kill Firefox process on Linux/OS X linux linux

How to gently kill Firefox process on Linux/OS X


You can use pkill with the process name:

pkill -f firefox


How about

wmctrl -c "Mozilla Firefox"

?

Is it what you want?

NOTEs:

  1. This command may need to be fired in same DISPLAY & probably same virtual desktop, on which your firefox is running.
  2. Only first matching window will be closed. You may need to loop this command.


In Mac OS X, you could use AppleScript to close it (adjust the application name as necessary; I don't have FireFox installed to test):

$ osascript -e 'tell application "FireFox"quitend tell'

This should trigger the same event that the Quit menu command triggers, so FireFox should shut down cleanly.

Obviously, this won't work in Linux.