Operating System - Linux
1820475 Members
2789 Online
109624 Solutions
New Discussion

Re: How to download the multiple files using wget

 
Narendra Uttekar
Regular Advisor

How to download the multiple files using wget

Hi,

Is there any way we can download multiple files using wget for e.g. when i try to download wget http://url/test*

 

Warning: wildcards not supported in HTTP.

 

Basically we want to download the files starting with test-nnnnn (where nnnnn  - can we any numbers) or *.XLS

 

Thanks,

Narendra

 

 

 

2 REPLIES 2
Steven Schweda
Honored Contributor

Re: How to download the multiple files using wget

> Is there any way we can download multiple files using wget [...]

   It depends.  If you could use FTP instead of HTTP, then wildcards
could be used.  If the Web server will return a list of files for a URL
like "http://url/", then you could do things with HTTP, too.  A Wget
option like --accept-regex=REGEX could be useful, for example.  Or, you
could first fetch the file list, then extract the names you want from
it, and finally use Wget to fetch the URLs which will get those named
files.  (-i/--input-file=FILE could be useful here.)

   An FTP server naturally provides directory listings.  This allows
Wget to get a directory listing, scan it for wildcard matches, and fetch
the resulting files.

   An HTTP server may or may not provide a directory listing, depending
on how the server is configured.  Generally, with HTML, Wget can follow
HTML _links_, but that works only if the server provides a HTML document
which contains suitable links.  Between my weak psychic powers and your
description, I don't how helpful your HTTP/FTP/whatever server will be.

drayson
Frequent Advisor

Re: How to download the multiple files using wget

If you have the right filenames (or they can be generated),

you could use a bash script which could download it for you.