Download a list of files with wget using wildcards
I have a list of files like:
...and want to download them all. One way is to write all names in a file and then:
$ wget -i url.txtBut for 50 links (at least), it's a little to long to write all in a file (even by copy and pasting, I have to edit one line 49 times.)
I tested something like:
$ wget
Warning: wildcards not supported in HTTP.
--2019-09-22 01:45:43--
Resolving test.com (test.com)... 12.12.12.12
Connecting to test.com (test.com)|12.12.12.12|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2019-09-22 01:45:43 ERROR 404: Not Found.How can I use wildcards in wget? Should I use any switches?
2 Answers
According to John1024, brace expansion is the solution:
$ wget for the list of files for a web page for Firefox there is a Firefox extension Linkgopher that will give you a page with links, then you can save that to a text file. It accepts a filter.
as you know wget can take a text file as input
this is mine, <> means your input or delete that parameter, edit: those braces didnt show up, so if there is no paramater given, put one in or delete it.
wget --input-file= --show-progress --limit-rate=200K --random-wait --no-directories --continue --rejected-log= --output-file= --directory-prefix= --user= --password=