How to resolve ‘bash wget command not found’ problem

`wget` command is used on Linux to download files from the web. It is a free tool that supports http, https and ftp protocols, and http proxies for downloading any file. It is called non-interactive downloader because It can work in the background. So, the user can disconnect from the system after starting the download and the downloading task will be completed by this command as background process. Using this command is beneficial, when downloading files from slow or unstable network. If the network disconnects for any reason before completing the download task, then this command will keep trying to complete the download when connected with the network. Sometimes, the Linux user get the error message, “ –bash:wget:Command not found” while executing this command. It indicates that `wget` utility is not installed on the operating system or it is not working properly. How you can resolve this issue on Ubuntu operating system and download the file by using `wget` command are shown in this tutorial.


wget [option] [URL]

Option and URL parts are optional for this command.  There are many options exist for this command. Some basic start-up options for this command are, -V or –version, -h or –help, -b or –background and -e or –execute. URL will contain the location from where the file will be downloaded. The uses of some common options are explained with examples in this tutorial.

Check `wget` command is installed or not

Run the following command to check the installed version of `wget` command. If the command is not installed before then you will get the error, “ –bash:wget:Command not found”.

$ wget –V

The following output shows that wget command of version 1.19.4 is installed on the system.

Install wget command on Ubuntu

Run the following command to install wget command on Ubuntu.

$ sudo apt-get install wget

After completing the install, again run the previous command to check the install version of this command. Run the wget command with –h option to display all option details of this command.

$ wget -h

Example-1: wget command without any option

The following `wget` command will download the index.html file from the site, and the file will be stored on the current working directory. ‘ls’ command is used here to check the html file is created or not in the current directory.

$ wget
$ ls

Example-2: `wget` command with -b option  

‘-b’ option is used with `wget` to complete the download in the background. The following command will download, file from the site, in the background.

$ wget -b

Example-3: `wget` command with -c option

‘-c’ option is used with `wget` to complete the partial download. It is mentioned in the beginning of this tutorial that `wget` command has resume capability. If any incomplete download exists in the current directory due to network error or other reason the `wget` will resumes the download to complete the task with ‘-c’ option. The following command will resume the download if the file, is downloaded partially before. Run the following command to complete the partial download of xampp installer file.

$ wget -c

Example-4: `wget` command with -O option

-O option is used with `wget` command to store the downloaded file with different name. The following command will download the file, google-chrome-stable_current_amd64.deb with the name, chrome.deb.

$ wget –O chrome.deb


The uses of different options of `wget` command are explained in this tutorial by using different examples. If the user facing any problem to use `wget` command for downloading any file, then this tutorial will help them to solve the problems.

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

Bash Alias Tutorial

How to use bash aliases Most of the users like to use shortcuts for running commands. There are many commands in Ubuntu...

Shell scripts – What can you change

In most, if not all, shells, you have a script that starts your shell. Learn how to change it and you can have your own...

Bash pipe tutorial

Your instructor says, “If you put this vertical bar after a command it will pass the message on to the next.” So, you...