mzoz
mzoz

Reputation: 1353

download successive files using wget

I want to download pdf files as http link http://cdn.cs50.net/2016/fall/lectures/#/week#.pdf using wget, where # is decimal number ranging from 1 to 11.

I've tried

wget http://cdn.cs50.net/2016/fall/lectures/{1..11}/week{1..11}.pdf 

which doesn't work, so I'm using wget -i download-list.txt. Is there less tedious ways to do it like one-line command?

Upvotes: 0

Views: 405

Answers (1)

Jagan N
Jagan N

Reputation: 2065

You may use bash for loop to download your files. Try below command

for week in `seq 1 11`; do wget "http://cdn.cs50.net/2016/fall/lectures/$week/week$week.pdf"; done

Upvotes: 1

Related Questions