Featured image of post Mac OS 環境變數設定

Mac OS 環境變數設定

查看檔案內容

cat ~/.zshrc

如果檔案不存在,或者存在直接進入編輯狀態

nano ~/.zshrc

鍵入i,開始編輯檔案,在檔案中添加下列內容并保存

source ~/.bash_profile


列出環境變數

printenv

列出環境變數下的 Path

echo $PATH

打開 bash profile

nano ~/.bash_profile

新增路徑到 PATH

1
export PATH=$PATH:路徑名稱

or

1
PATH=$PATH:路徑名稱

執行 bash profile

1
source ~/.bash_profile
Built with Hugo
Theme Stack designed by Jimmy