Getting wget to dowload only files with specific name patterns

3

1

I want to use wget to DL some files. I want to DL only files whose name that fit a certain pattern, e.g. ???.txt and not any other *.txt files. Can this be done with wget? I could only find a way to --accept/--reject files based on the extension. Thanks!

Adi

Posted 2010-03-18T20:24:23.437

Reputation:

Answers

4

You can use -A option with --accept Example : to download all the gif images from the website,

wget -r -A gif www.foobar.com

or

wget -r --accept=gif www.foobar.com

ukanth

Posted 2010-03-18T20:24:23.437

Reputation: 9 930

0

If you are downloading from an website, you don't -- HTTP doesn't support wildcards. But you can use the --mirror option which will try to mirror the entire site. Try mixing the --mirror and the --accept and see what happens.

MikeHoss

Posted 2010-03-18T20:24:23.437

Reputation: 297