AppleHow ToMac

How to Install Wget on Mac [Two Ways]

Install Wget to download software packages on your Mac easily.

Key Highlights

  • You can download and install the Wget on Mac using the Homebrew and Xcode tools.
  • For both tools, you need to use certain commands on the Mac terminal.

Wget is open-source free software that retrieves files from the internet using HTTPS, FTP, and HTTP protocols. This software is a non-interactive command line tool where you can download and recover files easily from robot.txt bots. Moreover, Wget can resume the aborted downloads using the protocols running in the background. It supports working on various environments such as LINUX, UNIX, Mac, and Windows. If you are looking to use Wget software on Mac, you can install it in two different ways.

  • Using Homebrew
  • Using Xcode

Install Wget Using Homebrew

To download the Wget command line tool, you need the help of Homebrew software. Homebrew is open-source software that helps you to download software packages on your Mac. Before installing Wget, you need to download Homebrew on your Mac.

1. On your Mac, open the Terminal and type the code.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

2. After entering the code on the Terminal, press Return. It will install the Homebrew software on your Mac.

To install Wget on Mac using Homebrew

3. After installing the software type, brew install wget on the Terminal. The installation process of Wget will begin instantly.

Apart from the default Terminal, you can use other terminal apps on Mac, such as TreeTerm, ZOC, Cathode, etc., to install Wget.

Install Wget Using Xcode

1. On the Mac Terminal type, xcode-select --install.

To install Xcode on Mac

2. Click Install on the pop-up to install Xcode on your Mac.

3. After installing the Xcode on your mac, type the following code to start the installation process of Wget.

cd ~/Downloads 
curl -O https://ftp.gnu.org/gnu/wget/wget-1.19.5.tar.gz

4. After that, extract and navigate the files into the folder and run the upcoming command.

tar -zxvf wget-1.19.5.tar.gz (To extract files)
cd wget-1.19.5/
./configure

5. In the next step, run the following command:

make 
make install
wget http://ftp.gnu.org/gnu/wget/wget-1.19.5.tar.gz

6. If any errors occur due to SSL, enter the command.

# ./configure --with-ssl=openssl

You can install Wget on your Mac device by following the above code procedures. Alternatively, you can. Alternatively, can also install Xcode on the Mac app store.

How to Use Wget Tool

If you want to download a single file or directory URL that is publicly accessible, you can download those files using Wget commands.

To download a single file, enter the below code.

wget -X path/to/local.copy http://example.com/url/to/download.html

Enter the following code to download the entire directory on Mac.

wget -e robots=off -r -np https://www.w3.org/History/19921103-hypertext/hypertext/

If you aren’t comfortable with the default keyboard on Mac, connect an external keyboard to Mac and type the commands easily.

Frequently Asked Questions

1. What are the best alternatives for Wget on Mac?

Some of the best alternatives for Wget on Mac are cURL, ArchiveBox, HTTPie, Aria2, uGet, Grab-site, etc.

Was this article helpful?
YesNo

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button