How to open a browser from terminal

Solution 1:

Just enter

open "http://www.google.com"

And it'll open it in your default browser

Solution 2:

To have your OS X machine open the default browser to a specific page, you just have to type:

open http://example.com/

Simple as pie. The open command was introduced way back on the NeXT operating system, and in its modern incarnation, uses LaunchServices to determine the appropriate application to open the given file or URL.

Solution 3:

I just use

open -a safari

to open a browser (safari as an e.g. here).


The open -a stand for "opens with the specified application". It is case-insensitive, so you can open Finder like

open -a finder

etc.