Macへコマンドをインストールする

Mactreewgetをインストールした記録です。

Macへコマンドを追加する方法としてHomebrewと呼ばれるMac OS用のパッケージマネージャーがあるそうです。RedHatLinuxで言うところのRPMYum等の仲間です。
Homebrewは奥さんがインストールを済ませておいたらしいので割愛します。

treeを追加する。

$ brew install tree
Error: Cannot write to /usr/local/Cellar

世の中そんなに甘くないようで、エラーになりました。
ではsudoで。

$ sudo brew install tree

WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.

To proceed, enter your password, or type Ctrl-C to abort.

Password:
Error: Cowardly refusing to 'sudo brew install'
You can use brew with sudo, but only if the brew executable is owned by root.
However, this is both not recommended and completely unsupported so do so at
your own risk.

親切設計。
brewのオーナーがrootではなかった為、止めてくれました。
書き込めなかったディレクトリのオーナーを確認し、suして再実行。

$ brew install tree
==> Downloading https://homebrew.bintray.com/bottles/tree-1.7.0.el_capitan.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring tree-1.7.0.el_capitan.bottle.1.tar.gz
🍺  /usr/local/Cellar/tree/1.7.0: 7 files, 112.4K

続いてwget

$ brew install wget
==> Installing dependencies for wget: openssl
==> Installing wget dependency: openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2f.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring openssl-1.0.2f.el_capitan.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local.

Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include

==> Summary
🍺  /usr/local/Cellar/openssl/1.0.2f: 466 files, 11.9M
==> Installing wget
==> Downloading https://homebrew.bintray.com/bottles/wget-1.17.1.el_capitan.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring wget-1.17.1.el_capitan.bottle.1.tar.gz
🍺  /usr/local/Cellar/wget/1.17.1: 9 files, 1.5M

少し賢くなりました。