17
16

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Homebrew コマンドが優先的に実行されるようにデフォルトパスに/usr/local/binを追加する

Last updated at Posted at 2013-11-15

OS X で Homebrew を利用している場合に、/usr/local/bin および /usr/local/sbin にあるコマンドを優先的に実行するためのメモ。

$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

これを

$ echo $PATH
/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin

に変更したい。対象は全てのユーザ。
そのためには、/etc/paths を編集します。

$ sudo vim /etc/paths
/etc/paths
/usr/local/bin
/usr/local/sbin
/usr/bin
/bin
/usr/sbin
/sbin

/etc/paths 変更後、シェルを再起動すると、パスが変更されます。

17
16
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
16

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?