Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 Mar 20 '10 at 11:46

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

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

wget -r -A gif


wget -r --accept=gif
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

You must log in to answer this question.