
wget is great command line *nix program for grabbing things from the web, but it doesn’t ship with macs. It’s also not a part of the developer tools package. Here’s the steps I used to build and install wget on my mac.
Grab the wget source code from http://ftp.gnu.org/pub/gnu/wget/wget-1.9.1.tar.gz . Open a terminal window and follow along:
tar xzf wget-1.9.1.tar.gz cd wget-1.9.1 ./configure make sudo make install
The wget binary should now be in your /usr/local/bin folder. Let’s also put /usr/local/bin in the shell path so we can type wget from the command line rather than the tedious /usr/local/bin/wget when we want to run the program. This is accomplished by editing ~/.bash_profile to add the following line:
PATH=$PATH:/usr/local/bin; export PATH
To get the shell to re-read this file again, type source ~/.bash_profile. Now whenever you start the terminal, /usr/local/bin will be in the path.
The other part of installing wget that needs a tweak is wget’s manual page isn’t found when running man wget from the terminal. To resolve this we need to edit the man configuration file.
sudo nano /usr/share/misc/man.conf
Scroll down a bit and below all the other lines beginning with MANPATH, add:
MANPATH /usr/local/man
You’ll have to logout and login again for this change to take effect, but once you do you’ll have a fully functioning copy of wget installed on your mac!

curl
Does curl, which is included with Mac OS X, not meet your needs?
Either is fine
wget is more a preference than anything else. Both apps are fine for sucking down the Internet, and more.
Just checking
Quite a few people who are used to wget don’t even realize that curl exists and is part of Mac OS X, so I figured it was worth asking. The two utilities break down along GNU/BSD lines, and of course, Mac OS X falls on the BSD side.
So, for example, when I set up Drupal on Mac OS X, I use launchd to run a one-line curl script to fetch cron.php — instead of using wget.
Just a Little Distracted, Sorry...
I'm all for wget, and all, but, where'd you find that awesome portrait of hang loose Jesus?! *That* is my next tattoo! I am not kidding.
Oh, and wget compiled and installed quite nicely on my Mac--about two minutes. I forgot how much I liked it.
Seriously: I am not kidding.
thanks
Works fine, thanks a lot. More, from the comment I discovered curl...
Best
-a-
Thanks for the man fix
Good work.
wget and scripting and fink
Yes, I understand curl works too, but some people have scripts which use wget.
Also, once you have installed fink, you can just do a:
fink install wget
curl won't do recursive gets
curl won't do recursive gets
/usr/local/bin in path on Leopard?
Just installed wget and discovered that /usr/local/bin is in path on Leopard.
In /etc/profile I found:
PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin"
export PATH
Since the date on /etc/profile is the date I upgraded to Leopard I guess this is not something I have done, but if it is: If you have more than one user on your mac, this might be a alternative, then you do not have to edit all user profiles.
thanks!
I was writing some shell scripts to do a drupal upgrade on my MAMP development environment and, to my dismay, I found that wget was not installed. Great step-by-step instructions!
man page correction
I installed this yesterday and the man page workaround listed did not work. No biggie, it was a simple solution. Instead of editing man.conf (actually in /etc on my leopard install) I simply did the following:
sudo ln -s /usr/local/man/man1/wget.1 /usr/share/man/man1
which creates a symboic link in a previously pathed location for man pages.
Thanks
Thanks for this, very useful.
Not sure why Leopard doesn't ship with wget as standard. Understand that curl essentially does the same thing but seeing as most *nix systems have wget installed it would make sense to follow suit right?
Post new comment