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:
|
|
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:
|
|
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.
This story, "cURLing for Wget" was originally published by JavaWorld.