Ubuntu – How to open an URL from command line to Firefox and “switch to tab”

command linefirefox

Firefox 5.0 has the option to "switch to tab" if the requested URL or search terms point to an already open URL (great thing by the way).

Now, to open a URL from command line to Firefox a mere firefox http://myurl.com would do, but even if that URL already is open, Firefox will open it once more in another tab.

How can I—from command line—tell Firefox to open the desired URL in an already existing tab if possible?

Best Answer

You can do it like:

firefox -new-tab "www.duckduckgo.com"