Ubuntu – What process of Google Chrome to kill to close window from terminal

google-chromekillprocess

Google Chrome usually has 8 to 9 processes running, even though only one window is open. Which one of these processes do I kill to safely close the Google Chrome window?

Here is my ps -Af | grep chrome output:

1000      2706     1  2 23:01 ?        00:00:52 /usr/bin/google-chrome-stable
1000      2713  2706  0 23:01 ?        00:00:00 /usr/bin/google-chrome-stable
1000      2714  2706  0 23:01 ?        00:00:00 /opt/google/chrome/chrome-sandbox /opt/google/chrome/chrome --type=zygote
1000      2715  2714  0 23:01 ?        00:00:00 /opt/google/chrome/chrome --type=zygote
1000      2719  2715  0 23:01 ?        00:00:00 /opt/google/chrome/nacl_helper
1000      2720  2715  0 23:01 ?        00:00:00 /opt/google/chrome/chrome --type=zygote
1000      2839  2706  0 23:01 ?        00:00:08 /opt/google/chrome/chrome --type=gpu-process --channel=2706.3.250838429 --supports-dual-gpus=false --gpu-driver-bug-workarounds=0,1,27 --disable-accelerated-video-decode --gpu-vendor-id=0x1002 --gpu-device-id=0x6760 --gpu-driver-vendor=ATI / AMD --gpu-driver-version=13.30
1000      2843  2839  0 23:01 ?        00:00:00 /opt/google/chrome/chrome --type=gpu-process --channel=2706.3.250838429 --supports-dual-gpus=false --gpu-driver-bug-workarounds=0,1,27 --disable-accelerated-video-decode --gpu-vendor-id=0x1002 --gpu-device-id=0x6760 --gpu-driver-vendor=ATI / AMD --gpu-driver-version=13.30
1000      3038  2720  1 23:08 ?        00:00:28 /opt/google/chrome/chrome --type=renderer --lang=en-US --force-[...very long options list]
1000      4505  4441  0 23:40 pts/0    00:00:00 grep --color=auto chrome

Best Answer

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).