Downloading files from the Internet using the command line on Mac OS X

The first time you try to download a file using the Terminal on Mac OS X, you’ll find out that there is no ‘wget’ or ‘fetch’ installed into the base system. Inquiring minds can find a solution after bashing their Tab key for a few near-random auto-complete guesses, but I’ll save you from that humiliating experience 🙂 Please welcome the ‘ftp’ tool. A fast visit to the man page for it will result in knowing that it’s not limited to the FTP only, and you can use it to download files over HTTP as well.

To download a file over HTTP, use this syntax in your Terminal session:

ftp http://www.domain.com/file.ext

To download a file over FTP, use this syntax:

ftp ftp://ftp.domain.com/file.ext

But wait, there is more! You can also use cURL that comes with the system to do the same:

curl -O http://www.domain.com/file.ext

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.