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!

link|improve this question
feedback

migrated from stackoverflow.com Mar 20 '10 at 11:46

This question came from our site for professional and enthusiast programmers.

2 Answers

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
link|improve this answer
feedback

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown