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:
http://www.url1.com
http://www.url2.com
http://www.url3.com
http://www.url4.com
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityHow 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:
http://www.url1.com
http://www.url2.com
http://www.url3.com
http://www.url4.com
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"
alias google-chrome='/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome'
. Probably similar for Firefox.
– David Winiecki
Dec 11 '14 at 20:58
I think this may be a nice solution:
cat /home/username/anyfolder/allmyURLs.txt | xargs firefox -new-tab
This question is very old but I will answer it to the benefit of people who will read it in the future.
If there is only a number changing in the url, then you can change the number as given below. If they are different urls then you can use jasonwryan's solution.
google-chrome --new-tab http://www.url{1..4}.com
The above command will expand as below in new google chrome tabs:
http://www.url1.com http://www.url2.com http://www.url3.com http://www.url4.com
This solution is typically to load all pages where you would have to do next, next to go through the pages.
On windows / cygwin... this worked for me:
#!/bin/bash -xe
browser="/cygdrive/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"
clients="fb aapl nflx "
for i in $clients
do
"$browser" --new-tab https://asite.com/dashboard/$i
done