Wget command list

Consider this to be a crash course on How To use Wget. Wget is by far the best (intelligent) download manager ever created for the common client server protocols on the web (HTTP, HTTPS, FTP). The amount of configuration options offered by Wget is so immense that the use of the command line may be necessary in some cases. Here is a list of useful Wget commands. Ports of Wget for other platforms exist, if you want to see more configuration option open the terminal and use.

wget -help

Basic use

The simplest command Wget can offer. This will download the the file movie.mp4 from domain.com, notice how the the protocol HTTP had to specified can be changed for FTP.

wget http://domain.com/movie.mp4

Resume interrupted download

Let’s say you are downloading a 2 GB file then Internet connection dies for some reason Wget only managed to download 1.5 GB out of the 2 GB. The -c option can be used to tell Wget to resume the partially downloaded file, no need to download again.

wget -c http://domain.com/bigfile.iso

Mirror a site

Mirror or make a copy of a web site with the -m option. Self explanatory.

wget -m http://domain.com

Bandwidth throttling

Not everybody has FIOS (not me) for those who for example share a DSL or ISDN line are some what limited in the amount of bandwidth they can spare. Wget provides a way to limit the amount of bandwidth used, basically you can limit how much bandwidth it can use.

wget --limit-rate=20k http://domain.com/movie.mp4

Increase re-tries

When dealing with an Internet connection that suffers from high latency resulting in long download times the downloads will likely fail to complete. Instead of letting the unknown happen raise the default amount of retries (20) to say 30. Hopefully this will give you a higher margin to complete the download.

wget --tries=45 http://domain.com/movie.mp4

Disguised as a web browser

Some sites will not allow download managers alone to retrieve the files stored on their server, instead they expect to see a web browser like Mozilla or IE. Well this minor obstacle can be overcome by telling Wget to disguised it self as Mozilla to retrieve the file.

wget -c -U Mozilla http://domain.com/movie.mp4

Download files from FTP server

To download the same file from a FTP server just change the protocol when issuing the Wget command.

wget ftp://domain.com/movie.mp4

Let’s say the site happens to be password protected, Wget allows the user to login with credentials.

wget ftp://username:password@domain.com/path/to/file

Feel free to mix and match the options above nobody got any where by refusing to experiment.