Tuesday, May 7, 2024
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 1667  / 3 Years ago, mon, november 22, 2021, 11:49:27

My access to the mysite.com/img/ directory is blocked.



However all the images in that directory are in the form n.jpg where n is the nth image.



My access to mysite.com/img/n.jpg is not blocked



Is there anyway I save images 1-500 (mysite.com/img/1.jpg to mysite.com/img/500.jpg)?



I'm using ubuntu 11.10


More From » command-line

 Answers
0

The easiest solution is probably to use bash brace expansions



wget http://mysite.com/img/{1..500}.jpg


There is also the option of doing a loop, allowing you to put a bit of wait between each requests.



for n in $(seq 1 500); do
wget http://mysite.com/img/${n}.jpg
sleep 0.1
done


(The above can be ran directly in the shell.)


[#39681] Tuesday, November 23, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
edseager

Total Points: 185
Total Questions: 105
Total Answers: 102

Location: Angola
Member since Wed, Apr 13, 2022
2 Years ago
;