Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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!

share|improve this question

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

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

2 Answers 2

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
share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.