How to launch default web browser from the terminal?


I was wondering what's the terminal command to open the default web browser.

sensible-browser is the command you're looking for.

Searching on Google I found the answer.

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. If a file is provided the file will be opened in the preferred application for files of that type. xdg-open supports file, ftp, http and https URLs.

xdg-open is part of xdg-utils package and it's already installed on Ubuntu 10.10.

You can also use:


And it will open the URL in the default browser.

With default Ubuntu setup only gnome-open command comes to mind.


I played around this a little. There is a problem with gnome-open — it won't invoke the default web browser unless you specify a url. That's a problem if you want to set up an icon or a...

0 0

The terminal emulates any other terminal you might be used to using on your network. The only difference is that it’s accessed directly within Auvik so you don’t have to leave your Auvik dashboard to check or modify your devices.

The Auvik terminal auto-connects to devices using Secure Shell (SSH) by default. If SSH doesn’t work, then Auvik Telnets in using the IP address we have on record.

How to launch a terminal window

Launching a terminal connection opens a new browser tab or window, depending on how your browser is configured to handle new windows.

Note: The Terminal button is only enabled for devices that allow for connection by SSH or Telnet.

From a device dashboard, hover over the Remote Management button and click Terminal. Enter the required credentials, if requested. You could be prompted for either your Auvik password, or the SSH username and password for the device. After you’ve entered the credentials, click Connect.

How to use the...

0 0

Except I am running on Ubuntu 14.04 and am interested in customizing the command line arguments passed to the browser. Is there a way to do this?

Programs use a variety of other programs to determine the default browser sensible-browser & xdg-open being two of them.

For xdg-open, you can use it simply by by running xdg-open http://URL, so xdg-open will open Google for instance.
This should be the same as running echo in terminal and clicking on the link should open the default browser (in my case, Firefox).
You can see what is the default browser using xdg-settings get default-web-browser:

$ xdg-settings get default-web-browser firefox.desktop

To set values, you do xdg-settings set default-web-browser LAUNCHER-FILE.desktop:

$ xdg-settings set default-web-browser chromium-browser.desktop

So now running echo and clicking on the link or running xdg-open...

0 0

Another way to do it is to use a temp file that redirects to the URL you want, then opening this file in the simulator. This isn't necessarily the best way, but it is a shorter command.

echo "'>" > ~/tmp/openURL.html; open ~/tmp/openURL.html -a /Applications/\

As in the other answers, you can replace the URL (I put with whatever you want. Just make sure you put http:// because open interprets arguments as filesystem paths by default.

Sadly, the bulk of the command is just the path to the iPhone Simulator...

0 0

What is the default browser on Windows? Is it the registered handler of the HTTP protocol? Is it the default client registered under Clients\StartMenuInternet?

If we assume that the HTTP handler is the default browser then you can use AssocQueryString to get information about the registration:

WCHAR szBrowser[MAX_PATH]; DWORD cch = MAX_PATH; AssocQueryString(ASSOCF_NOTRUNCATE, ASSOCSTR_EXECUTABLE, L"http", NULL, szBrowser, &cch);

As a side note, just getting the executable might not be the best option, the user could have configured it with parameters like --some-browser-option --profile c:\foo and those would be ignored. ASSOCSTR_COMMAND can retrieve the command but you need to replace %1 with a empty string.

Even if you do all of this it can still break in certain configurations. A protocol registration is not required to specify a executable, it is legal to just have a COM object. I would therefore recommend that you read the StartMenuInternet client as a...

0 0

Using the command line open tool, you can immediately launch any URL from the Terminal into the default web browser of Mac OS X. In other words, you’re launching the specified site into a GUI browser from the command line.

The syntax to open any URL into the default web browser like this is remarkably easy to use and remember:


You can try this with any URL, even complex URL strings, although long query strings are best when placed into quotations.

You can also use https and even specify port numbers:


Be sure to include http:// or https:// or it will look for a local file instead, while also offering a suggestion that you made an error: “Perhaps you meant ‘’?”

Remember that you can change the Mac default web browser at any time by using Safari Preferences – yes, you use Safari to change the OS X browser even if you have no intention on using Safari and want to...

0 0

Even though launching Terminal Server connections that are embedded into a web page is easy to do, there are some technical limitations. The default web page is limited to desktop connections, and this can be a problem if you've decided to have users launch individual applications instead of full desktops.

By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.

You also agree that your personal information may be transferred and processed in the United States, and that you have read and agree to the Terms of Use and the Privacy Policy.

Instead of using the embedded ActiveX control, you can build custom web pages that have links to individual applications. You'll remember from Chapters 5 and 10 that it's possible to create an "RDP" file containing Terminal Server application connection settings. You can then deploy this RDP file to your users.

Take this...

0 0