Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Can anyone tell me how to open a browser from the Terminal on a Mac?

share|improve this question

migrated from stackoverflow.com Dec 18 '09 at 20:05

This question came from our site for professional and enthusiast programmers.

add comment

5 Answers

Just enter

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

And it'll open it in your default browser

share|improve this answer
4  
open -a "Firefox" "superuser.com"; will open the link in any other application you specify. –  kubi Dec 18 '09 at 20:04
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

If the default application for opening HTML files has been changed to a text editor, open test.html would open the file in the editor.

You could open it in the default browser with open test.html -a "$(VERSIONER_PERL_PREFER_32_BIT=true perl -MMac::InternetConfig -le 'print +(GetICHelper "http")[1]')".

share|improve this answer
add comment

If you just want to open the browser, without a URL, use open with just the browser name:

open /Applications/Safari.app

open /Applications/Firefox.app

etc.

You can use open to open any application by name.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.