Linux utility wget is a free tool that is use to retrieving files using HTTP, HTTPS, and FTP protocols.
Wget has lots of features and capabilities to make it easy to retrieve large files from the internet, recursive downloads, or mirroring entire website or FTP sites.
The wget tool has the functionalities to run into the background without logged in to the system and can be called from cronjob scheduler, terminal, or bash scripts also.
There are multiple uses of wget utilities; some of the examples are below:
Example 1 – Download a Single file
$ wget https://wordpress.org/latest.zip –2017-10-14 03:46:06– https://wordpress.org/latest.zip Resolving wordpress.org (wordpress.org)… 126.96.36.199, 188.8.131.52 Connecting to wordpress.org (wordpress.org)|184.108.40.206|:443… connected. HTTP request sent, awaiting response… 200 OK Length: 8912693 (8.5M) [application/zip] Saving to: ‘latest.zip’ latest.zip 100%[===================================>] 8.50M 5.03MB/s in 1.7s 2017-10-14 03:46:07 (5.03 MB/s) – ‘latest.zip’ saved [8912693/8912693]
Example 2 – Download a file and save with different name
$ wget -O wordpress.zip https://wordpress.org/latest.zip
Example 3 – Download a file and save it in to specific location
$ wget -P /opt/wordpress https://wordpress.org/latest.zip
Example 4 – Download file in background
$ wget -b https://wordpress.org/latest.zip
Example 5 – Download a file and set download speed
$ wget –limit-rate=300k https://wordpress.org/latest.zip