Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 307
Zack Avatar asked Jan 27 '15 03:01

Zack


People also ask

How do I open Chrome from terminal?

Go to Desktop > Applications. Type Terminal in the search bar and click on the first result. Or you can skip the lengthy process and open a new Terminal session by pressing Ctrl + Alt + T on your keyboard. This will load up Google Chrome with the default homepage.

How to open Google Chrome on Linux terminal?

Working on the Terminal allows you to access the browser using a single command. To open Google Chrome with the help of the command line, follow the steps given below: Go to Desktop > Applications. Type Terminal in the search bar and click on the first result.

How do I call Google Chrome from terminal?

If you want to use an alias to call Chrome from terminal then you need to edit the bash profile and add an alias on ~/.bash_profile or ~/.zshrc file.The steps are below : Edit ~/.bash_profile or ~/.zshrc file and add the following line alias chrome="open -a 'Google Chrome'"

How to open Chrome in Windows 10 command prompt?

First, open the Command Prompt by typing “command” in the Windows 10 search bar and then selecting “Command Prompt” from the search results. In Command Prompt, run the following command: start chrome. Chrome will now open. You can also do the same thing from the “Run” window. Open Run by typing “Run” in the Windows 10 search bar and selecting ...

How do I open a local file in Google Chrome?

Edit ~/.bash_profile or ~/.zshrc file and add the following line alias chrome="open -a 'Google Chrome'" Save and close the file. Type chrome filename for opening a local file.


2 Answers

Have you tried?

google-chrome http://localhost:3000
like image 54
Diego Torres Milano Avatar answered Oct 16 '22 02:10

Diego Torres Milano


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 😉 }

like image 43
Bexultan Myrzatay Avatar answered Oct 16 '22 03:10

Bexultan Myrzatay