5

Is there a way to close a specific Chrome tab with a terminal command? I tried below commands:

  1. kill -9 <pid of Chrome tab>: Instead of closing a tab, it kills the tab ("He's dead Jim" message appears and tab remains)
  2. killall chrome: Closes all Chrome browsers open
2

1 Answer 1

-2

You can close a specific crome tab on follow way by terminal:

Change the active tab to the next right tab:

xdotool windowactivate --sync <window> key Ctrl + Tab

Change the active tab to the next left tab:

xdotool windowactivate --sync <window> Ctrl  + Shift + Tab

Close the active browser tab by:

xdotool windowactivate --sync <window> Ctrl + w

Remark: The Strg key on german keyboards is usually labelled Ctrl or Control on english keyboairds.

3
  • This is not an answer.
    – r2d3
    Commented Dec 18, 2021 at 1:42
  • The key which is labeled Strg on German keyboards is usually labelled Ctrl or Control internationally.
    – tripleee
    Commented Jan 10, 2022 at 13:42
  • @tripleee, Strg are changed now to Ctrl.
    – Alfred.37
    Commented Jan 10, 2022 at 13:47

You must log in to answer this question.