You’re trying to use the command-line tool wget to download a web page, image, video, etc., but you’re getting an error saying that wget is not recognized as an internal or external command, operable program, or batch file.

This can happen for several reasons:

  • You don’t have wget installed.
  • The PATH environment variable is not set up properly and wget is not in it.
  • There’s a typo in the command or file name that you’re trying to download.

Here are some solutions to the wget is not recognized error:

1. Installing wget (if you don’t have it)

Wget is available for most operating systems, but if it isn’t installed by default on yours, you’ll need to install it yourself.

Here’s how to install wget on Windows 10:

  • Download the latest Windows version of wget here. Download the setup executable file.
  • Once downloaded, open File Explorer and double-click on the setup executable file.
  • Once the installation is finished, press Windows + R shortcut key and type cmd.
  • Verify that wget is working by running:
wget -h

Wget on Mac

Here’s how to install wget on a Mac:

Download and install wget using Homebrew. If you don’t have Homebrew installed, follow our doc here.

brew install wget

Verify wget is installed and working by downloading wget using wget. Nice!

wget https://ftp.gnu.org/gnu/wget/wget-1.21.2.tar.gz

We don’t recommend installing wget using the source code. There are dependencies you have to install. If you don’t install the version of wget with the correct dependencies, the installation may fail.

2. Configuring your PATH variable (If you don’t have it)

To do anything useful on a computer, programs need to be “accessible” and this is done through something called the PATH environment variable. To set up your path variable, you need to configure it.

If you’re using Windows 10, please follow the steps below:

  • Open the Control Panel (Press Windows + R, type control, and then press Enter).
  • Click System and Security.
  • Click System.
  • On the left side, click Advanced system settings.
  • Click Environment variables.
  • Scroll to find a PATH variable in System variables section and press Edit.
  • When. a new window appears, click New.
  • Enter the following path:
C:\Program Files (x86)\GnuWin32\bin
  • Click OK to save all the changes.
  • Open the Command Prompt and type the following:
wget --help
  • If you see the usage for wget message, wget is now working.

4. (Fixing a typo or file name)

Sometimes you might misspell the command or path that you’re trying to use and Wget won’t recognize it. Here’s how you can fix this:

Leave a Comment