33

I'm trying to open firefox with two tabs from the command line, with two separate web addresses. So far I'm having no luck.

firefox -new-tab https://www.evernote.com/Home.action -new-tab http://www.gmail.com

Could someone point me in the right direction?

muru
  • 207,228
Andy J
  • 1,137

4 Answers4

37

Oops. I just found the answer. You need to add a -url after each `-new-tab'.

firefox -new-tab -url https://www.evernote.com/Home.action -new-tab -url http://www.gmail.com

Now it works. Hope this can help somebody.

muru
  • 207,228
Andy J
  • 1,137
15

You no longer need to add -url, simply write firefox followed by space-separated URLs.

Example:

firefox mail.google.com askubuntu.com stackoverflow.com
8

Create a file containing list of URLs called url.txt:

http://www.url1.xxx
http://www.url2.xxx
http://www.url3.xxx

Firefox uses the new-tab command, so you could pass the URLs in the file to the browser like so:

xargs -a url.txt firefox -new-tab "$line"
muru
  • 207,228
Maythux
  • 87,123
0

If you have a file tabs.txt with a URL on each line, you can use this command:

firefox $(cat tabs.txt) &

and it will open an instance of Firefox and a tab for each line.

Added the ampersand so it can run as a separate process.

To save the tabs, I am using a Firefox extension that copies the tabs to the clipboard. I save them in Documents to open later.

Pablo Bianchi
  • 17,371