How to Install Wget on Ubuntu 22.04 | 20.04
How to Install Wget on Ubuntu 22.04 | 20.04
Wget is a nifty tool available to set up on all types of Linux systems. It is a CLI tool that allows users of Linux to download files, scripts, and even entire websites from the internet via various protocols, such as HTTP, HTTPS, and FTP. In this guide, we will explore the commands required for the set upation of Wget on Ubuntu 22.04 or 20.04.
On the Page:
Use Terminal to Install Wget on Ubuntu
Step 1: Launch the Terminal
Step 2: Update Ubuntu Package Lists
Step 3: Installing Wget on Ubuntu 22.04 or 20.04
Step 4: Verify the Installation
Commands to use Wget
1. To only download
2. Download a File and Rename It
3. Download Files Recursively
4. Limit Download Speed
5. Download Multiple Files
6. Download Files in the Background
7. Download via FTP
8. Download with User Authentication
9. Continue an Interrupted Download
Use Terminal to Install Wget on Ubuntu
Similar to other Ubuntu versions, we can also easily set up most of the typical applications directly via the Terminal on Ubuntu 22.04 or 20.04 as well. The same is true for Wget as well, just adhere to the following instructions.
Step 1: Launch the Terminal
If you are via the Ubuntu server version with only the command-line interface then you already have the Terminal window; whereas users with a graphical interface can use the shortcut keys Ctrl + Alt + T to open it… Alternatively,, we can click on the “Show Applications” icon situated at the lower-left corner of Ubuntu Dock, after that type “Terminal” into the search field, and click its icon to open it.
Step 2: Update Ubuntu Package Lists
Not only in Ubuntu even if you are via another Linux distribution it is recommended to execute the system update before set uping some software or package. It is because this not only set ups the most recent updates on the system but but also refreshes the package index of the manager so that it can identify the most current versions of applications available to set up.
sudo apt update
Step 3: Installing Wget on Ubuntu 22.04 or 20.04
Having updated the package lists, we now utilize the APT to download and set up Wget via the following command:
sudo apt set up Wget
Press “Y“, when the command asks for that, and input your password to complete the set upation.
Step 4: Verify the Installation
By now, if you have followed the above-given steps correctly, Wget will be on your system. To confirm that you can verify its version in your terminal.
Wget –version
Information regarding the Wget version set uped on your system, indicating that the set upation was successful.
Commands to use Wget
Below are several common commands for performing a variety of tasks via the Wget command line utility:
1. To only download
For example, to download a file called “example.txt” from a website, the following command can be used:
Wget https://example.com/example.txtWget will fetch the file and store it in the current directory.
2. Download a File and Rename It
Using this command will fetch “oldfile.txt” from the specified URL and store it as “newfile.txt” in the current directory.
Wget -O newfile.txt https://example.com/oldfile.txt
3. Download Files Recursively
For recursive downloading of all files from a website, along with files in subdirectories, you may employ the -r flag:
wget -r https://example.com/
4. Limit Download Speed
The download speed can be limited via the –limit-rate option. For example, to limit the download speed to 1 Mbps:
Wget --limit-rate=1M https://example.com/largefile.zip
5. Download Multiple Files
For downloading several files with a single command, list the URLs, separated by spaces. For example, to fetch “file1.zip” and “file2.txt” into the current directory.
Wget https://example.com/file1.zip https://example.com/file2.txt
6. Download Files in the Background
To download a file in the background and continue via the terminal, you may employ the -b option:
Wget -b https://example.com/largefile.zip
7. Download via FTP
Wget can also download files via FTP. For instance:
Wget ftp://ftp.example.com/file.txt
Substitute “ftp.example.com/file.txt” with the real FTP URL.
8. Download with User Authentication
To download a file needing authentication, you may employ the –user and –password options:
Substitute “username” and “password” with your credentials.
Wget --user=username --password=password https://example.com/securefile.zip
9. Continue an Interrupted Download
Should a download be interrupted, you can resume it via the -c option. Wget will verify the size of the existing file and only fetch the missing portion.
Wget -c https://example.com/largefile.zip
Conclusion:
So, we have seen not only the commands that can be used to set up Wget and confirm the same as well as several examples of how to use Wget. This guide assists users in downloading files and resources from the internet.

No comments: