How to Open a Website from Terminal

By  on  

Every once in a while I want to open a website from the terminal ... just because.  Maybe it's because it makes me feel just a bit more hardcore, you know, not clicking a GUI icon.  Anyways, opening a browser via the command line is dead simple:

open https://davidwalsh.name

That execution will open the URL in the system's default browser.  If your prefer a specific browser, you can so specify:

open -a "Google Chrome Canary" http://cnn.com

Open a URL from the command line -- you'll feel like a true pro.

Recent Features

  • By
    Create a CSS Flipping Animation

    CSS animations are a lot of fun; the beauty of them is that through many simple properties, you can create anything from an elegant fade in to a WTF-Pixar-would-be-proud effect. One CSS effect somewhere in between is the CSS flip effect, whereby there's...

  • By
    CSS vs. JS Animation: Which is Faster?

    How is it possible that JavaScript-based animation has secretly always been as fast — or faster — than CSS transitions? And, how is it possible that Adobe and Google consistently release media-rich mobile sites that rival the performance of native apps? This article serves as a point-by-point...

Incredible Demos

  • By
    Parallax Sound Waves Animating on Scroll

    Scrolling animations are fun. They are fun to create and fun to use. If you are tired of bootstrapping you might find playing with scrolling animations as a nice juicy refreshment in your dry front-end development career. Let's have a look how to create animating...

  • By
    Styling CSS Print Page Breaks

    It's important to construct your websites in a fashion that lends well to print. I use a page-break CSS class on my websites to tell the browser to insert a page break at strategic points on the page. During the development of my...

Discussion

  1. Geopelia

    Like i child…

  2. danny

    Since aliasing gitwww to open the current github repo’s home page, ive saved prob. 2 mins/day. Plus is saves my fingers a trip to the mouse!

    • Ollie

      could you share how you made the alias dynamic to access the current repo’s homepage?

  3. I thought you’re gonna use lynx :))

  4. open didnt work :(
    but start did :) in windows environment

  5. Heh, you got me there! I thought you wrote an article about lynx :-) Thanks for sharing though, it’s especially useful when grabbing stuff using curl or wget…

  6. these days in zsh on OSX you need to wrap the url in quotes

    open 'https://davidwalsh.name/open-website-terminal'
    

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!