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 Chrome.app" --args 'http://google.com/'

It focuses Chrome but does not open the URL.

link|improve this question

feedback

migrated from stackoverflow.com Oct 25 '11 at 12:59

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

2 Answers

up vote 4 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)

link|improve this answer
weird. seems like i used to have to use them. thanks. – cwd Oct 18 '11 at 4:48
feedback

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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