What process of Google Chrome to kill to close window from terminal?

For the record, killing a process from Terminal isn't considered as "safely closing Google Chrome".

To kill the entire browser, you can run killall google-chrome-stable or (in this example) kill 2706 (note how the parent PID is 1, and all of the other processes stem down from this process).

To kill a tab, I can tell that process 3038 is a tab, but not which or what tab. You can run kill 3038 to kill the process running the tab, but note that the tab itself will still be open (but the content will be replaced with a blue screen).


If you don’t want to see “Google Chrome didn't shut down correctly. To repoen ...”, then it is important to signal only the root of the chrome process tree, like so:

pkill --oldest chrome

See full explanation. wmctrl -c (great program) only works with some window managers like Unity, and it only closes one window at a time so you would need a loop.


You can stop all of them with a single command:

sudo killall chrome

Then to prevent it from doinng this in the future, go into Settings, pick Advanced, and near the bottom you will find a switch where you can set it to NOT allow background processes to run when the program exits. Shut it off.