Can you dig it?

cURLing for Wget

Apr 18th, 2013

Wget is an extremely handy utility I use all the time when I find myself on a Linux box. It’s quite helpful, for example, for downloading files. Need to install Ruby? No problem, just download the binary like so:

wget example of downloading Ruby binary

1

wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p180.tar.gz

and you’re one step closer. There’s no flags to remember either.

Wget, however, isn’t natively available on OSX. From time to time, I’m stung to see the nefarious ‘command not found’ message after expectantly waiting to see some file I need downloaded.

Luckily, you can force cURL to act like Wget with a few flags. Simply use the -OL flags like so:

cURL acting like Wget

1

curl -OL http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p180.tar.gz

and you’ll be on your way to downloading some file.

Of course, it’s possible to get wget on your Mac via MacPorts or Homebrew; nevertheless, knowing you can achieve the same goals with cURL is always handy.