Super User is a question and answer site for computer enthusiasts and power users. 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

I have a text file download-list.txt which looks like this:

To download the files in the list I run

wget -i download-list.txt

Is there a wget magic that I can use that doesn't require me to make such a list?

share|improve this question
up vote 6 down vote accepted

If you are using a reasonably modern bash, you could use shell expansion like so:


The above will try to get image1.png all the way to image99.png. Obviously, choose your range as appropriate. Those files that don't exist should throw up an error, but cause no actual problems. If you want, you can probably suppress the errors with some wget option, or by redirecting STDERR to /dev/null:

wget{1..99}.png 2> /dev/null

For a truly huge number of files, you may come up against the limits of the command-line - there is a maximum number of arguments that can be on the command-line. You are highly unlikely to run into this problem, but in the event that you're dealing with a really huge number of files, a for loop might be safer:

for f in {1..1000}; do wget$f.png; done
##  and the version sending STDERR to /dev/null:
for f in {1..1000}; do wget$f.png 2> /dev/null; done
share|improve this answer
Wow. That worked. Thank you so much! – hpesoj626 May 9 '13 at 11:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .