Open a URL in the Default Browser from the Command Line

Using the command line open tool, you can immediately launch any URL from the Terminal into the default web browser. The syntax is remarkably easy:

open http://osxdaily.com

You can try this with any URL, even complex URL strings, although long query strings are best when placed into quotations. You can also specify port numbers:

open http://yahoo.com:80

Be sure to include http:// or https:// or it will look for a local file instead, but also suggest that you made an error: “Perhaps you meant ‘http://yahoo.com’?”

Comments are closed.