Marius van Witzenburg "Learned my lesson in life, now setting my action to stay in life."

16May/100

Download a range of files with Curl and Bash.

This is a really simple sniped how to download a range of files.

I found this very useful to download an image range of my old avatar script.
I lost my images but remembered an url where I uploaded them once. Happy me :-)

1
2
3
4
5
6
7
#!/usr/local/bin/bash
 
# Range 1 to 75
for x in {1..75}
do
    curl -O http://my.server.com/media/images_${x}.jpg
done
blog comments powered by Disqus