PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, May 14, 2022

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

 May 14, 2022     curl, ubuntu     No comments   

Issue

I want to simply be able to open a website from a curl command. 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:

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

explorer "google.com"

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

MacOS

open "google.com"

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



Answered By - Jeppe
Answer Checked By - Mary Flores (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing