问题
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.
回答1:
Have you tried?
google-chrome http://localhost:3000
回答2:
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 😉 }
回答3:
I dont seem to have this problem.
chromium-browser "http://localhost:8889"
chromium-browser "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.)
回答4:
As stated beautifully by @Bexultan Myrzatayev, if google chrome is your default browser, simply
open http://localhost:8000
来源:https://stackoverflow.com/questions/28162697/how-can-i-open-google-chrome-from-the-terminal-with-the-url-localhost3000