How to Install wget on MacOS

WGET is a free tool to crawl websites and download files via the command line. In this wget tutorial, we will learn how to install and how to use wget.

image
DownloadNp
Last Updated: May 27th 2021

What is Wget and What Does it Do?

  • WGET is a free tool to crawl websites and download files via the command line.
  • It lets you download files from the internet via FTP, HTTP or HTTPS (web pages, pdf, xml sitemaps, etc.).
  • It provides recursive downloads, which means that Wget downloads the requested document, then the documents linked from that document, and then the next, etc.
  • It follows the links and directory structure.
  • It lets you overwrite the links with the correct domain, helping you create mirrors of websites.

Check if Wget is installed

Open Terminal and type:

$ wget -V

If it is installed, it will return the version.

 

Download Wget on Mac

The recommended method to install wget on Mac is with Homebrew.

First, install Homebrew.

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Then, install wget.

$ brew install wget

 

Now you can use wget command.

 

If you got error something like this while installing wget, then follow below steps :

Error:
 homebrew-core is a shallow clone.
 homebrew-cask is a shallow clone.
To `brew update`, first run:
 git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
 git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow

How to remove the shallow clone warning from HomeBrew:
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow

brew update

brew upgrade

 

Please Login to Comment