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.
and finally install it.
sudo make install
And of course make sure it works.
Congratulations, you have successfully compiled wget from source.