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.

Zack
  • 874
  • 1
  • 9
  • 18

5 Answers5

38

Have you tried?

google-chrome http://localhost:3000
Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134
18

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 }

Bexultan Myrzatay
  • 1,105
  • 10
  • 17
  • 2
    I really like this answer, since it is browser-agnostic. It opens the URL in the default browser, whatever it is. – Krzysztof Chris Mejka Dec 07 '18 at 11:19
  • `chromium-browser`, `chrome`, `google-chrome`, `open`, and `chromium` are all `command not found` for me, using bash in linux – Justin Feb 07 '21 at 00:09
  • `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. – BobHy Jul 28 '22 at 20:48
3

This is what worked for me:

open  -a "Google Chrome" http:localhost:3000
stevec
  • 41,291
  • 27
  • 223
  • 311
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.)

Community
  • 1
  • 1
Damian Nikodem
  • 1,324
  • 10
  • 26
0

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

open http://localhost:8000
bmc
  • 817
  • 1
  • 12
  • 23