简体   繁体   中英

Downloading similar files from a site using wget

I would like to download my Programming assignments from my school account.For some courses where the files follow a sequential order,it was easy to use wget to download all the files.However,I could not download all .cpp files and the error encountered was that http does not support wildcards.

The example bash script I tried to use looked something like the below:

#!bin/bash
a=.pdf
s=myschool_acount_
for (( c=1; c<=9; c++ ))
do
   wget $s$c$a
done

the above worked,but on trying wget $s/$wildcard where wildcard is $*.cpp i got the error saying http does not support wildcard.Any help would be appreciated. Note,I can manually download my files but I would like to know for the future how I can use wget to go about this..

You can use -A flag with wget

'-A acclist --accept acclist'

wget --no-parent -r -l 1 -A *.cpp http://url/loc/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM