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
    Welcome to My New Office

    My first professional web development was at a small print shop where I sat in a windowless cubical all day. I suffered that boxed in environment for almost five years before I was able to find a remote job where I worked from home. The first...

  • By
    I’m an Impostor

    This is the hardest thing I've ever had to write, much less admit to myself.  I've written resignation letters from jobs I've loved, I've ended relationships, I've failed at a host of tasks, and let myself down in my life.  All of those feelings were very...

Incredible Demos

  • By
    MooTools Overlay Plugin

    Overlays have become a big part of modern websites; we can probably attribute that to the numerous lightboxes that use them. I've found a ton of overlay code snippets out there but none of them satisfy my taste in code. Many of them are...

  • By
    MooTools dwCheckboxes Plugin

    Update / Fix: The checkboxes will no longer toggle when the "mouseup" event doesn't occur on a checkbox. Every morning I wake up to a bunch of emails in my Gmail inbox that I delete without reading. I end up clicking so many damn checkboxes...

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!