【ターミナル】どのコマンドのPATHが通ってるか確認【zsh】

もくじ

環境

Apple M2
macOS Ventura 13.0
zsh

デフォルトのパスを確認

% echo $path

/opt/homebrew/bin /opt/homebrew/sbin /usr/local/bin /System/Cryptexes/App/usr/bin /usr/bin /bin /usr/sbin /sbin /Library/Apple/usr/bin

パスの設定ファイル

特に意識していなければ下記ディレクトリの.zprofileファイルです。

/Users/{ユーザ名}/.zprofile

ファイルの中身

catコマンドでファイルの中身を確認できます。(VScode等でも確認できます)

% cat /Users/{ユーザ名}/.zprofile 

eval "$(/opt/homebrew/bin/brew shellenv)"

筆者はまだHomebrewしかパスを通していないので上記の通りです。