Search my blog
Custom Search

Tuesday, September 30, 2008

How to use wget to download globbing files

You want to download all the GIFs from a directory on an HTTP server.
You tried wget http://www.server.com/dir/*.gif, but that didn't work
because HTTP retrieval does not support globbing.

In that case, use:
wget -r -l1 --no-parent -A.gif http://www.server.com/dir/

More verbose, but the effect is the same. -r -l1 means to retrieve
recursively, with maximum depth of 1. --no-parent means that refer-
ences to the parent directory are ignored, and -A.gif means to down-
load only the GIF files. -A "*.gif" would have worked too.
>>From mget manual.

You can use globbing for downloading globbing files from ftp servers.
wget ftp://ftp.server.com/dir/*.gif

--