wget command
Introduction
• Wget is the non-interactive network downloader
which is used to download files from the server
• GNU (GNU's not Unix) Wget is a command-line utility
for downloading files from the web.
• With Wget, we can download files using HTTP, HTTPS,
and FTP protocols.
• Wget provides a number of options
• download multiple files
• resume downloads
• limit the bandwidth
• recursive downloads
• download in the background
• mirror a website
How to Download a File with
Wget
• In it’s simplest form when used without any option,
wget will download the resource specified in the
[url] to the current directory.
$wget https://www.tutorialspoint.com/python3/python_tutorial.pdf
• Wget starts by resolving the IP address of the
domain
• connects to the remote server
• starts the transfer
• During the download
• Wget shows the progress bar alongside with the file
name, file size, download speed, and the estimated
time to complete the download.
• current working directory
Download file with different name
• Using -O (uppercase) option, downloads file with
different file name.
Download multiple file with http and ftp protocol
• download multiple files
using HTTP and FTP protocol with wget command
at ones.
Read URL’s from a file
• we can store number of URL’s in text file and
download them with -i option.
• we have created tmp.txt under wget directory
• put series of URL’s to download.
Resume uncompleted download
• In case of big file download, it may happen
sometime to stop download
• we can resume download the same file where it
was left off with -c option.
• But when you start download file without
specifying -c option wget will add .1 extension at
the end of file, considering as a fresh download.
• So, it’s good practice to add -c switch when you
download big files.
Download file with appended .1 in file name
when we start download without -c option wget add .1 at
the end of file and start with fresh download.
If .1 already exist .2 append at the end of file.
Download files in background
• With -b option we can send download in
background immediately after download start and
logs are written in /wget/log.txt file.
Restrict download speed limits
• With Option --limit-rate=10k, the download speed
limit is restricted to 100k and the logs will be
created under /wget/log.txt