1

I've learned how to kill it by simply using

pkill Chrome

but how do I open it in bash in OS X ?

3 Answers 3

1

You can use /usr/bin/open -a command to run your browser. adding --args will open the browser from the command line and go to the target URL

/usr/bin/open -a "/Applications/Google Chrome.app" --args 'http://google.com/'
Sign up to request clarification or add additional context in comments.

2 Comments

are you there ... also, the --args works on Chrome, Firefox, and Opera, but not Safari as Safari prepends it with file:// breaking any URLs. How can I get this to work for Safari ?
Sorry, went offline. Safari is a bit weirder. /Applications/Safari.app/Contents/MacOS/Safari & sleep 1 && osascript -e 'tell application "Safari" to open location "http://www.google.com"'
1

This should do it:

$ open -a "Google Chrome"

or

$ open -a Google\ Chrome

More information:

$ manx open

3 Comments

thanks why does this not work - open -a "Firefox.app" ... should be the same correct ?
It works for me... and you shouldn't need to include the extension, since you're telling the open command that it's an app with the -a option.
...you missed the args though ... ILLILI
0

You should not need the full path of open as bash already knows where to find this.

It also knows where to find Chrome.

However you do need the full path of Chrome:

open -a "Google Chrome" --args 'gmail.com' 

1 Comment

You shouldn't need "/Applications/" either... try just "Google Chrome" or "Google Chrome.app".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.