Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux: command to open URL in default browser

What command we have to execute (from Java, but that should not matter) on Linux (different common distributions) to open a given URL in the default browser?

like image 730
Mot Avatar asked Feb 25 '11 11:02

Mot


People also ask

How do you call a URL in Linux?

“command to hit url in linux” Code Answercurl http://www.example.com/: good for normal use and debugging. Has lots of options. Especially usefull: --verbose to see the HTTP request/response and --head to send a HEAD request (no body). openssl s_client -connect www.example.com:443: Useful for debugging HTTPS servers.

How do I open a URL in Ubuntu terminal?

xdg-open opens a file or URL in the user's preferred application. If a URL is provided the URL will be opened in the user's preferred web browser. gnome-open works as well as xdg-open but neither knows what to do with naked domain. So gnome-open http://askubuntu.com works but not gnome-open askubuntu.com .

How do I change my default browser in Linux?

Under System Settings > Applications > Default Applications > Web Browser, change the "Open http and https URLs" setting to "in the following application" and choose your preferred browser from the dropdown list, then apply the change.


1 Answers

The most cross-distribution one is xdg-open http://stackoverflow.com

like image 160
shellholic Avatar answered Oct 24 '22 22:10

shellholic