CentOS Wget Install and Usage

29/12/2020
When working with Linux, especially on the professional and enterprise environment, there’s always the necessity of downloading a number of files from the internet time to time. Especially in the professional environment that requires a lot of scripting, a suitable download manager is always welcome.

For the enterprise, RHEL is the most suitable one as it’s well maintained with tons of support from both the community and the developers. CentOS, on the other hand, is the free edition of RHEL that offers a great ground for practicing and getting a grab of the enterprise environment.

Are you a CentOS user? So am I! I recently started my journey with CentOS on my virtual machine.

For scripting and other purposes, “wget” is an extremely suitable choice. Wget is a part of the GNU Project software that offers a very basic download manager. It’s free and open-source and capable of handling all the popular Internet protocols like HTTP, HTTPS, FTP and FTPS.

Wget is a non-interactive command-line tool. That makes it extremely suitable for almost any purpose. Let’s get wget in our CentOS!

Checking existence of wget

By default, CentOS should come up with wget. Make sure that your system comes up with wget by running the following command –

wget

If you didn’t get the result, you should install wget into your system right now!

Installing Wget

There are 2 different ways of installing wget into your system – installing from CentOS repository or, building it from source.

Grabbing wget from CentOS repo

At first, make sure that your system is up-to-date –

sudo yum update

Then, run the command for installing wget –

sudo yum install wget

  • Installing from source

This method applies to all the other Linux distros as well. We have to grab the source code and build it in our system.

Make sure that your CentOS system comes up with all the necessary development tools –

sudo yum groupinstall “Development Tools”
sudo yum install glibc-devel glibc-headers kernel-headers kernel-devel gnutls-devel

Grab the source code from the official GNU FTP server

Then, extract the source code –

tar -xvzf wget-latest.tar.gz

Now, start the building process –

cd wget-1.20/
./configure

make -j3

Finally, perform the installation –

sudo make install

Wget usage

Wget is a very simple tool to use. Generally, all you need to tell is the download link of the file. For example, let’s download the source code of “wget” once again –

wget ftp.gnu.org/gnu/wget/wget-latest.tar.gz

There are also a number of other advanced options available. For example, you can set the file name of the download into a different one using “-O” flag.

wget -O wget-source.tar.gz ftp.gnu.org/gnu/wget/wget-1.19.tar.gz

Need to download multiple files? Just state their respective download URLs one after another!

wget ftp.gnu.org/gnu/wget/wget-1.6.tar.gz ftp.gnu.org/gnu/wget/wget-1.7.tar.gz

It’s also possible to download all the links from a file. For example,

# download.txt
https://ftp.gnu.org/gnu/wget/wget-1.6.tar.gz
https://ftp.gnu.org/gnu/wget/wget-1.7.tar.gz

Now, tell wget to use the file as the source of download URLs –

wget -i downloads.txt

For an in-depth guide on wget, you should use the “wget” help page.

wget –help

Enjoy!

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

CentOS Versus Ubuntu

Your server needs a stable operating system that you can depend on, and both CentOS and Ubuntu are popular choices that...
29/12/2020

Mẹo #1: Thống kê số lần truy cập của các IP vào website

Các tấn công DoS/DDoS bất ngờ vào trang web có thể gây ra thiệt hại với trang web của bạn. Ở bài...
30/12/2020

Jitsi [Part 2] – Hướng dẫn cài đặt Jitsi Meet trên Ubuntu 18.04 LTS

Jitsi hiện đang là một trong số những công cụ hội nghị truyền hình mã nguồn mở được sử...
30/12/2020
Bài Viết

Bài Viết Mới Cập Nhật

Cách gắn set proxy cho điện thoại android, oppo, giả lập android, Ldplayer Bằng Proxydroid
20/09/2023

Mua Proxy Socks5 VN Chơi Game Gia Lập Tăng Cường Trải Nghiệm Chơi Game
22/06/2023

Mua Proxy Mỹ, Us Nuôi Tài Khoản Etsy, eBay Tìm Hiểu Về Mua Proxy Mỹ tại Onet.com.vn
22/06/2023

Mua Proxy Game – Giải pháp tuyệt vời cho việc chơi game trên mạng mà không bị giới hạn về vị trí địa lý
03/06/2023

Sử dụng Proxy để Quản Lý Tài Khoản Quảng Cáo Ads Một Cách An Toàn
27/05/2023