Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 1059  / 3 Years ago, mon, november 8, 2021, 7:59:57

My aim is to download only the files available on websites such as those on http://pelusa.fis.cinvestav.mx/tmatos/LaSumA/LaSumA2_archivos/NumeRCPs/ansi/index.htm under the "Access via Directories:" title. How can I achieve my aim I am not familiar with wget and I do not want to obtain the html files, I would like to download only the *.c and *.h files on that site for example. Is it possible? I think downloading specific file types and saving to a desired place is a function provided by wget.


More From » wget

 Answers
2

This will retrieve all .c and .h files:



wget -r -l1 --no-parent -A c,h http://pelusa.fis.cinvestav.mx/tmatos/LaSumA/LaSumA2_archivos/NumeRCPs/ansi/recipes/


Result will be a directory structure



pelusa.fis.cinvestav.mx/
tmatos/
LaSumA/
LaSumA2_archivos/
NumeRCPs/
ansi/
recipes/


and the .c and .h files will be in recipes/ (it will not save in the same target directory since that could overwrite files).






There are other tools that might be easier, like lftp (it supports globbing better than wget).


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

Total Points: 164
Total Questions: 108
Total Answers: 106

Location: Ghana
Member since Sun, Mar 27, 2022
2 Years ago
;