Linux

Linux Wget ( File Downloader) Command With Example

In this article, we will learn about the Wget Linux utility command which is used to download the files from the world wide web over the protocols HTTP, HTTPS, FTP, FTPS.

Wget is a free Linux command-line utility software and it has so many features that make it easy to download from the web. Some of the features are:

  • Can resume downloads.
  • Downloads multiple files at the same time.
  • Recursively mirror directories.
  • Support persistent HTTP connections.
  • Support IPv4 and IPv6 downloads.
  • Set bandwidth and speed limit for downloads.

The basic syntax is:

$ wget [option] [URL]

Now we will install Wget in the Linux system but before installing, check if it has already been installed or not by running the following command.

$ rpm -q wget         [RHEL/CentOS/Fedora and Rocky Linux/AlmaLinux]
$ dpkg -l | grep wget [Debian, Ubuntu and Mint]

Install Wget

$ sudo yum install wget         [RHEL/CentOS/Fedora and Rocky Linux/AlmaLinux]
$ sudo apt install wget         [Debian, Ubuntu and Mint]

$ sudo pacman -Sy wget          [Arch Linux]
$ sudo zypper install wget      [OpenSUSE]
$ sudo emerge -a net-misc/wget  [Gentoo Linux]

At this point, I’m assuming you have installed the Wget utility command and now we will use this command to download the files with different options.

A. Download a File

This command will download a single file (chrome browser) and will store it in the current directory. Additionally, you can see the downloading progress, file size, date, etc.

# wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

--2022-02-20 10:10:39--  https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
Resolving dl.google.com (dl.google.com)... 2a00:1450:400e:80c::200e, 172.217.168.206
Connecting to dl.google.com (dl.google.com)|2a00:1450:400e:80c::200e|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 90840348 (87M) [application/x-debian-package]
Saving to: ‘google-chrome-stable_current_amd64.deb’

google-chrome-stable_cur 100%[==================================>]  86.63M  22.9MB/s    in 3.8s

2022-02-20 10:10:43 (22.7 MB/s) - ‘google-chrome-stable_current_amd64.deb’ saved [90840348/90840348]

Download File with Different Name

Suppose a file name is very long and you want a different or short name, you can do it by placing -O (uppercase) in the command.

# wget -O chrome.zip https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

--2022-02-20 10:21:59--  https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
Resolving dl.google.com (dl.google.com)... 2a00:1450:400e:80c::200e, 172.217.168.206
Connecting to dl.google.com (dl.google.com)|2a00:1450:400e:80c::200e|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 90840348 (87M) [application/x-debian-package]
Saving to: ‘chrome.zip’

chrome.zip                           100%[===================================================================>]  86.63M  22.9MB/s    in 3.8s

2022-02-20 10:22:03 (22.6 MB/s) - ‘chrome.zip’ saved [90840348/90840348]

We can do a lot with Wget command such as checking the version of the command, resuming the download, multiple downloads at once, and many more.

You Might Also Like

More Similar Posts

Tags

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Menu
0
Would love your thoughts, please comment.x
()
x