9

In Ubuntu, to control Opera from the command line you would use the command

opera -remote "openURL(www.google.com)"

is there a command like that for Google Chrome? Using the command

/usr/bin/google-chrome www.google.com

just opens a new window.

1
  • Works for me, and should work in general. – Hasturkun Aug 10 '11 at 14:59
8

The chromix project might be what you're looking for. It allows control of chrome and its tabs from the command line (or within a script).

Disclaimer: I'm it's author.

5

This worked for me, opening my personal website in a new Chrome window on Ubuntu Linux:

google-chrome http://dotancohen.com

It looks like you are missing the initial http:// part.

2
google-chrome google.com

Also if google Chrome is the default browser then it can be opened using:

xdg-open https://google.com

But xdg-open expects https:// to be appended before the URL. If you don't add it then it will search for file on your local machine.

On Gnome this can be used (this will also use the default browser)

gnome-www-browser google.com

Taken from here: https://askubuntu.com/questions/19919/command-to-open-a-url

1

Here is another (more generic) way to do that (assume chrome is your default browser) :

gnome-open http://superuser.com/
0

I would just do chromium-browser (for chromium), or google-chrome, and instead of depending on it being there in /usr/bin/google-chrome just rely on you PATH, or if you really want to know exactly where it is just type which google-chrome and it will give you the path note that the which command will tell you the static location of an application

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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