How to download all files (but not HTML) from a website using wget?

Aniruddhsinh picture Aniruddhsinh · Jan 6, 2012 · Viewed 257.6k times · Source

How to use wget and get all the files from website?

I need all files except the webpage files like HTML, PHP, ASP etc.

Answer

Zsolt Botykai picture Zsolt Botykai · Jan 6, 2012

To filter for specific file extensions:

wget -A pdf,jpg -m -p -E -k -K -np http://site/path/

Or, if you prefer long option names:

wget --accept pdf,jpg --mirror --page-requisites --adjust-extension --convert-links --backup-converted --no-parent http://site/path/

This will mirror the site, but the files without jpg or pdf extension will be automatically removed.