If you’ve been working with Linux for some time, you know how to use wget command. Wget is a very handy tool that allows you to download files from the internet. If you see the error ‘wget command not found’ when you try to use this tool, that means you don’t have it installed.
In this article, I will show you how to install and use wget in the Linux operating systems as well as the commands for wget in Linux.
What is wget?
The wget command is one of the most important utilities used on Linux systems and it helps us in downloading images, documents, PDF’s and much more from the web. Whether you’re using Linux or some other OS, you should know the wget command if you want to work with files from remote servers.
It supports HTTP, HTTPS, and FTP URLs. It also supports proxy connections for both FTP and HTTP. Wget works in the background, so you can leave it running and return to it after a while.
You can also start it at any time during your session. It is safe to let wget be your default FTP client because Wget will not be confused when two login offers appear simultaneously.
Check if wget is Installed
If wget is installed, you should be able to run it from the terminal. Run this command to check the version of wget:
$ wget -V
Make sure that the wget package is installed on your system. In Ubuntu Linux or Debian, check if wget is installed by entering the following into a terminal window:
$ which wget
You should get the path to wget as the output. If not, wget is not installed in your system.
Install wget on Ubuntu Linux or Debian
To install wget on Ubuntu Linux or Debian, enter this command:
$ sudo apt-get install wget
After installation complete, check if wget is installed by running the command in the above section again.
Download wget from the Internet
If you’re not able to install wget using the method above, you can install it by downloading it by running this command:
$ curl -O https://ftp.gnu.org/gnu/wget/wget-latest.tar.gz
Once installed, extract the files in the gzip file:
$ tar zxvf wget-latest.tar.gz
After the files have been extracted, a new folder is created. Go into this folder, and run these commands to install wget:
$ cd wget-XXX $ ./configure $ make $ sudo make install
After installation, you can follow the section above to verify wget is installed.