Get updates via: rss | twitter | email | google+

wget - Downloading from the command line

Written by Guillermo Garron .
Date: 2007-10-30 10:36:30 -0400

Tips and Tricks of wget

When you ever need to download a pdf, jpg, png or any other type of picture or file from the web, you can just right-click on the link and choose to save it on your hard disk. This is possible for one or even up to five files, but more than that.

wget is a GNU program, which is used a lot in Linux, it can download pages, and files from the internet directly to your computer.

If you do not have it installed you can install on:

Debian or Ubuntu

sudo apt-get install wget

wget tips

Download a single file


Download the whole site recursively

wget -r

Download all files of a specific type: (pdf and jpg for example)

wget -r -A pdf,jpg

Follow external links

wget -r -H -A pdf,jpg

Follow external links only to specific server

wget -r -H -A pdf,jpg -D

Limit the levels you will dig when in recursive mode (default is 5)

wget -r -l 2

Limit the bandwidth used by wget (to 20KB/s in this case)

wget --limit-rate=20k

As you can see, wget is very useful and flexible, use it at your wish.


If you enjoyed the article, please share it

twitter | facebook | google+ | linkedin | email | reddit