How can I open Google Chrome from the terminal with the URL "localhost:3000"?
Asked Answered
H

5

23

Whenever I try to open Google Chrome with the URL "localhost:3000" it messes up and simply opens a blank tab with no URL. After some testing I've figures out it is the ":" messing it up. This works:

$ google-chrome www.gmail.com

but this does not work

$ google-chrome localhost:3000

nor this

$ google-chrome "localhost:3000"

How can I open Google Chrome with this URL? I am using Ubuntu, bash script, and the gnome-terminal.

Handicraft answered 27/1, 2015 at 3:21 Comment(0)
B
39

Have you tried?

google-chrome http://localhost:3000
Beggs answered 27/1, 2015 at 3:25 Comment(0)
R
19

Got the following message:

zsh(or bash): command not found: google-chrome (or chromium-browser)

Solved my problem:

open http://localhost:3000

{ I use Google Chrome as a default browser πŸ˜‰ }

Ribald answered 19/12, 2017 at 9:47 Comment(3)
I really like this answer, since it is browser-agnostic. It opens the URL in the default browser, whatever it is. – Vault
chromium-browser, chrome, google-chrome, open, and chromium are all command not found for me, using bash in linux – Respirator
open links to xdg-open on my system, and that is a fantastically useful command to know. Can open local files in various apps based on type, including those nasty PDFs. – Vouge
P
5

This is what worked for me:

open  -a "Google Chrome" http:localhost:3000
Perception answered 6/4, 2022 at 3:59 Comment(1)
Excellent solution, especially for situations where Chrome is not the default browser. – Sacaton
M
2

I don't seem to have this problem.

chromium "http://localhost:8889"
chromium "http://127.0.0.1:8889"

One quick suggestion would be to check to see if 127.0.0.1:3000 works (newer versions of ubuntu seem to have an issue resolving "localhost" instead of the numbered IP address.)

Mihrab answered 27/1, 2015 at 3:28 Comment(0)
C
0

As stated beautifully by @Bexultan Myrzatayev, if google chrome is your default browser, simply

open http://localhost:8000
Cartwright answered 25/12, 2018 at 22:47 Comment(1)
What does this answer bring to the table? Honest question. – Respirator

© 2022 - 2024 β€” McMap. All rights reserved.