Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

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

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

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

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