I can close google chrome with following bash command:
kill -9 $(ps -x | grep "Google Chrome" | awk "{print $1}")
It closes all instances of google chrome.
But I need command that close all the instances of google chrome except first, because music is playing there and I don't want to stop it.
I use word instance
to express new google chrome window which opens after I press super N.
Best Answer
To close all windows except the frontmost window, run:
To close all windows except the window opened first, run a script like this in AppleScript Editor:
"Instances" are usually called windows in OS X, and windows are not separate instances of a process like the instances opened by
open -n
.