The wget tool is an extremely useful command that allows you to download files from websites from the command line. Before you begin you should make sure you have Xcode installed. If you don’t, just download it from the App Store, its free.
To install wget on your mac you first need to download the source code from here. Next you need to extract the tarball. You can do this by double clicking the file in Finder or you can run the following command in the terminal
tar -zxvf ~/Downlaods/wget-1.14.tar.gz
Run the rest of these commands in the Terminal app.
Next we will cd into the directory.
cd ~/Downloads/wget-1.14
Then,
./configure --with-ssl=openssl
Make it
make
and finally install it.
sudo make install
And of course make sure it works.
wget --help
Congratulations, you have successfully compiled wget from source.