ubuntucurl

How can I open a site in web browser from command line?


I want to simply be able to open a website in a browser from the command line. I haven't been able to find anything related as of yet. All the results that pop up are mainly for mobile apps and their respective development languages. I want to be able to do something like:

curl <some flag or option> google.com

And then the google.com webpage pops up. Is something like this possible?


Solution

  • Lets collect the various ways to open a URL the default browser:

    Ubuntu

    sensible-browser google.com or xdg-open google.com.

    This is also answered here: https://askubuntu.com/questions/8252/how-to-launch-default-web-browser-from-the-terminal

    Windows

    start chrome https://www.google.com/ or start firefox https://www.google.com/

    Answered here: https://stackoverflow.com/a/32775952/3717691

    MacOS

    open "google.com"

    Answered here: https://stackoverflow.com/a/23039509/3717691