Wget is a Linux command line utility that is used to retrieve files from World Wide Web(WWW) and makes use of protocols like HTTPS and FTP. It is a freely available package and can be downloaded and installed on any Linux supporting architecture.
One of the key features of wget is its ability to automatically start downloading where it was left off in case there is a network issue. It should also be noted that it deletes files recursively and it will keep trying to download all the files until it has been retrieved completely.
sudo apt-get install wget
yum install wget
Now we know about wget, let’s first explore an example where we will try to download a file from a url with the help of the wget command.
immukul@192 linux-code % wget http://ftp.gnu.org/gnu/wget/wget-1.5.3.tar.gz --2021-07-11 12:12:20-- http://ftp.gnu.org/gnu/wget/wget-1.5.3.tar.gz Resolving ftp.gnu.org (ftp.gnu.org)... 22.214.171.124 Connecting to ftp.gnu.org (ftp.gnu.org)|126.96.36.199|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 446966 (436K) [application/x-gzip] Saving to: 'wget-1.5.3.tar.gz' wget-1.5.3.tar.gz 100%[========================================================>] 436.49K 285KB/s in 1.5s 2021-07-11 12:12:23 (285 KB/s) - 'wget-1.5.3.tar.gz' saved [446966/446966]
Now, if we want to use a proxy with the wget command, we can make use of either of the two approaches mentioned below.
wget -e use_proxy=yes -e http_proxy=localhost:8080 ...
use_proxy=yes http_proxy=localhost:8080 https_proxy=localhost:8080
Both the above approaches will enable you to run the wget with a proxy on.