Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How I would go about opening multiple URLs from a text file as different tabs in Firefox/Chrome? My text file is just a list of URLs, one per line:

share|improve this question

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

while read line; do
    firefox --new-tab "$line"
done < textfile.txt

With Chrome, the syntax is:

google-chrome "$line"
share|improve this answer
On OS X you can make this work with Chrome with something like alias google-chrome='/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome'. Probably similar for Firefox. – David Winiecki Dec 11 '14 at 20:58
@sepehr thanks: fixed. – jasonwryan Dec 9 '15 at 19:48

I think this may be a nice solution:

cat /home/username/anyfolder/allmyURLs.txt | xargs firefox -new-tab
share|improve this answer
"$line" is wrong in this answer: xrag applies the strings from the input file each as parameter to its subcommand. I corrected the answer accordingly. – halloleo May 25 '15 at 3:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.