Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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


mkdir -p sun-yat-sen && wget --directory-prefix=sun-yat-sen -r  -nd -np -A.jpg -erobots=off

There are several pics on the link:, after the download process,what i get is all those junk jpg files which could not open by my gnome imgae viewer.

so,what is the reason ?
thanks in advance

share|improve this question
What happens if you run file foo.jpg on one of the downloaded files in a terminal? If it says it's html, James's answer is very likely correct. – poolie Apr 18 '11 at 9:31

Wikipedia has information pages about each image it hosts with the name of that image (e.g. It is probably these pages that you are downloading, when what you really want is the corresponding image (which would be for the previous example).

share|improve this answer
thanks for the reply. And do i have to download those manually ? – Tracy Apr 18 '11 at 16:59
I don't know of an automated way to get the full size images associated with the article. There are a few libraries that can help you interact with Wikipedia that might help, but I don't know of a ready-made solution. – James Henstridge Apr 19 '11 at 3:05

Your Answer


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.