Let's suppose that I have access to a site index and in a specific directory of this index I have a lot of images, but some of those images were resized (the originals are still there). The resized images have their own name, following this standard: [image-name][-resolution].jpg, and the original images have their name following this standard: [image-name].jpg.

  • So, I'd like to know how to download all the original images, using wget?

Note: There is no space in the image names, and I specified that the file type is .jpg, because I don't know if there is any difference in downloading this type of file.

  • Maybe duplicate of unix.stackexchange.com/questions/17604/… – Arcadien Jan 21 '13 at 14:19
  • @Aurelien Questions are only considered as 'possible duplicates' if they are actually on Ask Ubuntu itself. – user76204 Jan 21 '13 at 16:03
  • You probably want to look at the answers in this question. – user76204 Jan 21 '13 at 16:03

wget supports regexes with the --accept-regex parameter.

So wget -A "1024x768.jpg" would download any file ending with "1024x768.jpg". If you want different sorts of resolutions the digits can be changed to match d+. Something like:

wget -A "d+xd+.jpg$"

(pseudo example). The regex depends on the shell you use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.