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 download all the *.gif files from a particular location. For example, say the location is*.gif. When I use:

wget -m

I get a 403 (permission denied) error. But when I use:

wget -m

It works perfectly. There are about 50 images; how can I download them? I can't write 50 wget commands

share|improve this question

migrated from Jun 28 '10 at 18:28

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

Do you know the filenames? – SLaks Jun 28 '10 at 18:25
Don't repost your questions. This is the same as Image folder download using wget. – Matthew Flaschen Jun 28 '10 at 18:27
If you know the filenames this is trivial, especially if they are sequential (image001, image002, etc...) – John T Jun 28 '10 at 18:33
@Matthew I think the problem here is this fellow posted the same question on and Naturally, someone at stackoverflow migrated the question here and it was duplicated. – ghoppe Jun 28 '10 at 19:21

This is not possible.

wget cannot know which files exist on the remote server.

Instead, if the server has directory browsing enabled, or if the images are linked somewhere, you can crawl some other page.

share|improve this answer

I don't know why no one has suggested wget -r. OP is hitting a server that has directory listing disabled, but anyone passing through here should know that wget can handle recursive fetching easily. It can even filter by file types.

share|improve this answer
Points to you for answering my question. I was indeed passing through and had forgotten about that flag, thanks! – cincodenada Jan 5 '13 at 1:05
One warning that I just learned: unless you want to traverse up to parent directories and download the whole damn website, add the -np or --no-parent flag, so that wget only descends downwards in the tree. – cincodenada Jan 5 '13 at 3:17

You first example is trying to get a directory listing. The server has directory listing disabled and returning a 403.

share|improve this answer

You must log in to answer this question.