What makes it so high in demand?
Well, wget comes with a lot of impressive and beneficial features associated with it. It is an incredible and powerful command-line tool. Wget supports you to download several files from the internet. Additionally, it will retrieve the file in various protocols for instance HTTP, FTP, and HTTPS.
As it is a command-line tool, wget is generally called from the bash. This is the reason that sometimes when you execute some commands, you may see a message saying, bash: /usr/bin/wget: No such file or directory, error.
If you are facing the same problem, then we are here with a solution and cause of its occurrence.
Let’s dive in and understand the topic in detail.
Wget command not found
In most of the Linux distributions, for instance, Mint, Debian, Ubuntu, CentOS, etc, wget command is not pre-installed.
Hence, when you try to you may see an error as stated below:
bash: /usr/bin/wget: No such file or directory
As you have read that this error is called from the bash therefore you see bash: in the error message.
This message implies that the wget binary cannot be found in a specific binary path /usr/bin. That further means that you do not have wget installed in your system.
To be double sure, use the following command to search the file as well as the folder:
You will see such a screen on your display as shown in the given snapshot.
As it is evident that the system does not have wget command installed in it, let us install it.
How to install wget command
The most common solution for the error, bash: /usr/bin/wget: No such file or directory, that you see on your screen is to install wget command.
The best method to install this tool is via a repository with the package management tool. It is an incredibly reliable as well as an easy method.
Let’s begin the procedure.
How to install wget on Ubuntu, Mint, Debian
To install wget command, you have the option to use two commands as stated below:
sudo apt install wget
sudo apt-get install wget
These packages use the package managers like apt or apt-get to perform installation, removal, updating of the packages. As you can see above, we have used the same package managers.
Now, moving on! Let us understand the process to install wget on Fedora, CentOS, Fedora, RHEL.
How to install wget on Fedora, CentOS, RHEL
The distributions like CentOS, Fedora, RHEL, use package managers like yum or dnf for the purpose of installation, removal, or updating of packages. Therefore, we will use these package managers to install the wget command. Take a look.
sudo dnf install wget
sudo yum install wget
Now that you have successfully installed wget on your respective devices, it’s time to check the command version.
How to display the wget command version?
There are various ways through which you can check the version of wget command. Here we are going to use the -v option to discover the same.
The command you have to execute is:
Your output screen will look like this as shown in the below snapshot.
As you can see the GNU wget 1.20.3 version is installed on the system.
Here are a few examples of the most commonly used wget commands. Take a look:
wget command with -b option
You can use this option when you wish to resume the download in the background and continue your task as is. Here is the syntax:
wget command with -c option
wget command has the ability to resume the file from where it stopped rather than starting it from scratch. Use the following command to meet your requirements:
wget command with -o option
You can use this option to save the file that you download with a specific file name. Take a look at the below-stated command:
Undoubtedly, wget is a powerful and incredible tool. We hope that the information helps you to clarify all your ambiguities related to the wget command.