If your terminal shows wget: command not found, the fix is quick. This error appears because wget is either missing from your machine or your shell can’t locate it. wget is a command-line tool that downloads files over HTTP, HTTPS, and FTP. Most Linux distributions include it by default, but macOS and Windows do not. This guide covers every step to get wget working on any operating system in 2026.
Why Does the “wget: command not found” Error Show Up?
Two situations trigger the wget: command not found message:
| Cause | Explanation |
|---|---|
| wget is not installed | Your OS did not ship with wget, or it was never added manually. |
| wget is not in your PATH | The binary exists on your machine, but the shell doesn’t know where it lives. |
Before installing anything, check whether wget already exists. Type this into your terminal:
wget --version
A version number means wget is ready to use. If you still see wget: command not found, continue with the installation steps below.
How to Install wget on Your Operating System
Each OS uses a different package manager. Pick the section that matches yours.
Debian or Ubuntu
Refresh your package list first, then install wget:
sudo apt update sudo apt install wget
After the process finishes, run wget --version to confirm the setup worked. You can also read more about fixing similar command-not-found errors on Linux.
RHEL, CentOS, and Fedora
On these distributions, dnf handles package management:
sudo dnf install wget -y
Older CentOS 6 builds use yum instead:
sudo yum install wget
macOS
Apple does not include wget. Homebrew makes the setup painless. First, install Homebrew if you haven’t already:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then pull in wget:
brew install wget
For a full walkthrough, see the wget on Mac guide.
Windows
Windows doesn’t bundle wget either. Download the binary from an official source, grab the correct build (32-bit or 64-bit), and drop wget.exe into a PATH-accessible folder like C:\Windows. Open Command Prompt and test with wget --version.
How to Add wget to Your System PATH
Sometimes wget is installed but your shell can’t find it. That means the directory holding wget isn’t listed in your PATH variable. Check your current PATH:
echo $PATH
Look for common directories like /usr/bin or /usr/local/bin. If the folder containing wget is missing, append it:
export PATH="/path/to/wget:$PATH"
Make this permanent by adding that line to ~/.bashrc or ~/.zshrc, then reload with source ~/.bashrc. For a detailed walkthrough, check the guide to adding directories to PATH in Linux.
On Windows, open System Properties, go to the Advanced tab, click Environment Variables, and edit the PATH entry to include the folder where wget.exe sits.
Common wget Commands After Installation
Once the wget: command not found error is gone, try these everyday commands:
| Task | Command |
|---|---|
| Download a single file | wget https://example.com/file.txt |
| Rename the downloaded file | wget -O newname.txt https://example.com/file.txt |
| Download multiple files | wget URL1 URL2 URL3 |
| Mirror a directory | wget -r https://example.com/docs/ |
| Limit bandwidth to 1 MB/s | wget --limit-rate=1m https://example.com/file.txt |
| Resume a partial download | wget -c https://example.com/bigfile.zip |
For the complete list of flags and options, check the wget man page.
FAQs
Why do I get “wget: command not found” on macOS?
Apple does not ship wget with macOS. You need to install it through Homebrew by running brew install wget in your terminal after setting up Homebrew.
Can I use curl instead of wget?
Yes. curl comes pre-installed on most systems and handles file downloads. Use curl -O URL to download a file. wget is better for recursive downloads and mirroring sites.
How do I check if wget is already installed?
Run wget --version in your terminal. If it prints a version number, wget is installed. If you see “command not found,” it needs to be installed.
Does wget work on Windows?
Yes, but you have to install it manually. Download the wget.exe binary, place it in a PATH-accessible folder like C:\Windows, and it will work from Command Prompt.
What if wget is installed but still not found?
Your PATH variable is likely missing the directory where wget lives. Run which wget to find it, then add that directory to your PATH in ~/.bashrc or ~/.zshrc.