View Full Version : [ubuntu] wget how could i disable all filetypes expect any one filetype

July 6th, 2008, 11:25 AM
I want to download only .jpeg files from a web site excluding all other file types [even excluding HTML]

What is the command i should use.

July 6th, 2008, 11:52 AM
From wget manpage:

Recursive Accept/Reject Options

-A acclist --accept acclist
-R rejlist --reject rejlist
Specify comma-separated lists of file name suffixes or patterns to
accept or reject (@pxref{Types of Files} for more details).

July 6th, 2008, 12:04 PM

I know about -A and -R.

But i dont know how to download only jpeg.

I dont want any other formates or file type.

If i follow the -R i should specify all formates except .jpg

Could you give me a example

to do so,Ie i want only only only jpeg and not even .html.

July 7th, 2008, 11:27 PM
Sorry about the delay in replying, I only just got round to checking my older posts.

If you want to download only .jpg files, you want to use the -A (accept) option. So, an example of this would be:

wget -A .jpg http://example.com

The result of this command would be to download just .jpg files from the webpage example.com. I'm a bit rusty on this, but I think you'd also need the -r (recursive) option to have wget search the whole site.

Hope this helps.

July 7th, 2008, 11:40 PM
wget -r -l4 --no-parent -A .jpg http://example.comIf you have more then 1 web site :

wget -r -l4 --no-parent -A .jpg -i <file>where <file> contains the listing of sites.