There is a gallery in the format:
http:\\DOMAIN\file0001.jpg
⇒ http:\\DOMAIN\file0543.jpg
How can I download them all using wget
?
How can I make it wait 2 seconds between downloads?
i'm using bash ver 3.2.
In bash:
for ((i=1; i<=500; i++)); do wget http://DOMAIN/file`printf "%04d" $i`.jpg; done
If you want to wait 2 seconds between downloads, add a sleep 2;
before the done
Use ranges with {..}
.
$ wget http://example.com/file{0001..0543}.jpg
The above answer works with zsh
and bash
version 4 and above. See the answer posted by @w00t if you're using an older version of bash (bash -version
to check).
http://domain/
), never backslashes.