OS X Terminal Download File Commands is a Guide to Offer You Different Options with Explanations to Download File from Remote Server/Website. We have many comprehensive guides on Command Line Interface, mainly for the new users. Mac is more about OS X; that is UNIX and Command Line Interface provides the most wider range of tools. To use your Mac properly for Power Usage, learning these basics are important. We are using Homebrew – which is a Package Manager (you can read on how we installed Homebrew as step by step Guide.)
There are various package managers, it is wise to create a profile file before hand. In fact, we can install apt-get on OS X, apt-get is mainly intended for Linux not UNIX. Let us come back to our main topic – OS X Terminal Download File Commands is a Guide.
OS X Terminal Download File Commands is a Guide : Understanding the Whats
A download can be offered in various ways, over SSH, over HTTP, via FTP and so on. By default, OS X has cURL installed. Supported protocols by cURL include HTTP , HTTPS , FTP , FTPS , DICT , LDAP , RTMP etc.
---
On Linux, usually wget is more used; which we can also install on OS X (via Homebrew Package manager). It is better if the user has minimum idea about the commonly used UNIX Commands.
OS X Terminal Download File Commands is a Guide
As cURL is pre-installed and supports a wider protocols, usually examples for typical tutorial on OS X Terminal Download File Commands is started with cURL. A typical example is :
1 2 | # Format: curl <option> <url> curl -O http://cie-wc.edu/Microprocessor-7-19-2011.pdf |
Apple has big guide on usage of cURL :
1 | https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/curl.1.html |
From the options you will understand that, if we use this command instead, we will get a kind of progress bar :
1 | curl -# -O http://cie-wc.edu/Microprocessor-7-19-2011.pdf |
We said about wget, indeed; to install wget; you can cURL the source :
1 | curl -O http://ftp.gnu.org/gnu/wget/wget-1.13.4.tar.gz |
But, we can use Homebrew to easily install wget :
1 | brew install wget |
Usage of wget is easy and official examples are here :
1 | https://www.gnu.org/software/wget/manual/ |
You can wget the wget source-code indeed :
1 | wget http://ftp.gnu.org/gnu/wget/wget-1.13.tar.gz |
wget has lot of options too. Third common way is to use scp-command, it runs on top of SSH :
1 | scp username@remote.host:/path/to/file localfile |
If you can’t use scp or SFTP for tar bals, you can use tar over SSH:
1 | tar cf - . | ssh otherhost "cd /mydir; tar xvf -" |
rsync has different usage, we are not mentioning here.