Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I open a URL in Google Chrome from the terminal in OS X?

This is what I'm trying:

/usr/bin/open -a "/Applications/Google" --args ''

It focuses Chrome but does not open the URL.

share|improve this question

migrated from Oct 25 '11 at 12:59

This question came from our site for professional and enthusiast programmers.

why do you reference the open programm by it's path? It's aliased by default! –  nimrod May 11 '13 at 4:31

7 Answers 7

up vote 19 down vote accepted

If you remove the --args it seems to work fine, since --args can only affect things on first launch (it changes what main gets called with)

share|improve this answer
weird. seems like i used to have to use them. thanks. –  cwd Oct 18 '11 at 4:48
thanks for explaining the --args behaviour –  memeLab Apr 12 at 7:19

actually for me, the command is not working with the "--args" being present so the command working for me is

/usr/bin/open -a "/Applications/Google" ''

OS X version: 10.6.8

share|improve this answer
+1 This seems to be the real answer! :) –  Resist Design Jan 16 '13 at 17:46

If you set Google Chrome as your default browser


will just do the trick.

OS X version: 10.8.4

share|improve this answer
OS X 10.10 Yosemite as well. –  leymannx Jun 17 at 9:28

Get rid of the --args. open already knows how to handle URLs.

share|improve this answer

I've an alias for google

function google() { open /Applications/Google\ " $1"; }
share|improve this answer
that's a great idea :) –  nimrod May 11 '13 at 4:30
for zsh: chrome() { open -a "Google Chrome" "$1"; } –  nbari Jun 17 at 10:02

You can use

open -a "Google Chrome" index.html

or, to put it in a shell script (e.g. ~/bin/chrome)

  • edit the file ~/bin/chrome, and put the following in it

    open -a "Google Chrome" "$*"

  • make the file executable by running the following in a terminal

    chmod 700 ~/bin/chrome

  • then run the following to open a file in chrome from the terminal

    chrome /path/to/some/file

Pulled from here

share|improve this answer
function chrome(){ open -a "Google Chrome" "$*" } –  Joel AZEMAR Jul 1 at 7:40
  • make Google Chrome default browser
  • cmd + double click on URL (on recent OS X versions)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.