Manjaro Linux 22.0 “Sikaris” Released With Linux Kernel 6.1

Linux Wget Examples

$ wget [option] [URL]
=========================================
First, check whether the wget utility is already installed or not in your Linux box, using the following command.
$ rpm -q wget [On RHEL/CentOS/Fedora and Rocky Linux/AlmaLinux]
$ dpkg -l | grep wget [On Debian, Ubuntu and Mint]

=============================================
If Wget is not installed, you can install it using your Linux system’s default package manager as shown.
$ sudo apt install wget -y [On Debian, Ubuntu and Mint]
$ sudo yum install wget -y [On RHEL/CentOS/Fedora and Rocky Linux/AlmaLinux]
$ sudo emerge -a net-misc/wget [On Gentoo Linux]
$ sudo pacman -Sy wget [On Arch Linux]
$ sudo zypper install wget [On OpenSUSE]

The command will download a single file and store it in a current directory. It also shows download progress, size, date, and time while downloading.

# wget http://ftp.gnu.org/gnu/wget/wget2-2.0.0.tar.gz

–2021-12-10 04:15:16– http://ftp.gnu.org/gnu/wget/wget2-2.0.0.tar.gz
Resolving ftp.gnu.org (ftp.gnu.org)… 209.51.188.20, 2001:470:142:3::b
Connecting to ftp.gnu.org (ftp.gnu.org)|209.51.188.20|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 3565643 (3.4M) [application/x-gzip]
Saving to: ‘wget2-2.0.0.tar.gz’

wget2-2.0.0.tar.gz 100%[==========>] 3.40M 2.31MB/s in 1.5s

2021-12-10 04:15:18 (2.31 MB/s) – ‘wget2-2.0.0.tar.gz’ saved [9565643/9565643]

=============================

Using -O (uppercase) option, downloads files with different file names. Here we have given the wget.zip file name as shown below.

# wget -O wget.zip http://ftp.gnu.org/gnu/wget/wget2-2.0.0.tar.gz

–2021-12-10 04:20:19– http://ftp.gnu.org/gnu/wget/wget-1.5.3.tar.gz
Resolving ftp.gnu.org (ftp.gnu.org)… 209.51.188.20, 2001:470:142:3::b
Connecting to ftp.gnu.org (ftp.gnu.org)|209.51.188.20|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 446966 (436K) [application/x-gzip]
Saving to: ‘wget.zip’

READ More Relevant Stuff:  Tutorial To Install Apache On CentOS 8 [How To]

wget.zip 100%[===================>] 436.49K 510KB/s in 0.9s

2021-12-10 04:20:21 (510 KB/s) – ‘wget.zip’ saved [446966/446966]

===================
To download multiple files at once, use the -i option with the location of the file that contains the list of URLs to be downloaded. Each URL needs to be added on a separate line as shown.

For example, the following file ‘download-linux.txt‘ file contains the list of URLs to be downloaded.
# cat download-linux.txt

https://releases.ubuntu.com/20.04.3/ubuntu-20.04.3-desktop-amd64.iso
https://download.rockylinux.org/pub/rocky/8/isos/x86_64/Rocky-8.5-x86_64-dvd1.iso
https://cdimage.debian.org/debian-cd/current/amd64/iso-dvd/debian-11.2.0-amd64-DVD-1.iso

========================
To download or mirror or copy an entire website for offline viewing, you can use use the following command that will make a local copy of the website along with all the assets (JavaScript, CSS, Images).
$ wget –recursive –page-requisites –adjust-extension –span-hosts –convert-links –restrict-file-names=windows –domains yoursite.com –no-parent yoursite.com

=======================
With -b option you can send a download in the background immediately after the download starts and logs are written in the wget.log file.

$ wget -b wget.log https://releases.ubuntu.com/20.04.3/ubuntu-20.04.3-desktop-amd64.iso

Continuing in background, pid 8999.
Output will be written to ‘wget.log’.

========================
With -b option you can send a download in the background immediately after the download starts and logs are written in the wget.log file.

$ wget -b wget.log https://releases.ubuntu.com/20.04.3/ubuntu-20.04.3-desktop-amd64.iso

Continuing in background, pid 8999.
Output will be written to ‘wget.log’.

=================
View the wget.log file and check the download speed of the wget.

$ tail -f wget-log

5600M ………. ………. ………. ………. ………. 0% 104M 8h19m
5650M ………. ………. ………. ………. ………. 0% 103M 8h19m
5700M ………. ………. ………. ………. ………. 0% 105M 8h19m
5750M ………. ………. ………. ………. ………. 0% 104M 8h18m
5800M ………. ………. ………. ………. ………. 0% 104M 8h18m
5850M ………. ………. ………. ………. ………. 0% 105M 8h18m
5900M ………. ………. ………. ………. ………. 0% 103M 8h18m
5950M ………. ………. ………. ………. ………. 0% 105M 8h18m
6000M ………. ………. ………. ………. ………. 0% 69.0M 8h20m
6050M ………. ………. ………. ………. ………. 0% 106M 8h19m
6100M ………. ………. ………. ………. ………. 0% 98.5M 8h20m
6150M ………. ………. ………. ………. ………. 0% 110M 8h19m
6200M ………. ………. ………. ………. ………. 0% 104M 8h19m
6250M ………. ………. ………. ………. ………. 0% 104M 8h19m

READ More Relevant Stuff:  Best Tools To Access Linux Drive In Windows 11

===============
To ignore the SSL certificate check while downloading files over HTTPS, you can use the –no-check-certificate option:

$ wget –no-check-certificate https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-5.1.1.tar.gz

–2021-12-10 06:21:21– https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-5.1.1.tar.gz
Resolving mirrors.edge.kernel.org (mirrors.edge.kernel.org)… 147.75.95.133, 2604:1380:3000:1500::1
Connecting to mirrors.edge.kernel.org (mirrors.edge.kernel.org)|147.75.95.133|:443… connected.
WARNING: The certificate of ‘mirrors.edge.kernel.org’ is not trusted.
WARNING: The certificate of ‘mirrors.edge.kernel.org’ is not yet activated.
The certificate has not yet been activated
HTTP request sent, awaiting response… 200 OK
Length: 164113671 (157M) [application/x-gzip]
Saving to: ‘linux-5.1.1.tar.gz’

=================
To download a file from a password-protected FTP server, you can use the options –ftp-user=username and –ftp-password=password as shown.

$ wget –ftp-user=narad –ftp-password=password ftp://ftp.example.com/filename.tar.gz

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply

    Your email address will not be published. Required fields are marked *