Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ignore specific type of files to download in wget?

How do I ignore .jpg, .png files in wget as I wanted to include only .html files.

I am trying:

wget  -R index.html,*tiff,*pdf,*jpg -m http://example.com/ 

but it's not working.

like image 936
Nisar Avatar asked Jul 14 '13 10:07

Nisar


People also ask

How do I make wget silent?

-q --quiet Turn off Wget's output.

How do I change the default download folder in wget?

When downloading a file, Wget stores it in the current directory by default. You can change that by using the -P option to specify the name of the directory where you want to save the file.

How do I download all files in a folder using wget?

You can actually initiate a download and disconnect from the system, letting wget complete the job. Wget's -P or --directory-prefix option is used to set the directory prefix where all retrieved files and subdirectories will be saved to.


1 Answers

Use the

 --reject jpg,png  --accept html 

options to exclude/include files with certain extensions, see http://www.gnu.org/software/wget/manual/wget.html#Recursive-Accept_002fReject-Options.

Put patterns with wildcard characters in quotes, otherwise your shell will expand them, see http://www.gnu.org/software/wget/manual/wget.html#Types-of-Files

like image 124
mvw Avatar answered Sep 19 '22 11:09

mvw