1. 程式人生 > 其它 >Mac 環境變數載入

Mac 環境變數載入

技術標籤:linux

Mac系統的環境變數,載入順序為

# 系統級別,系統啟動就回載入
/etc/profile      
/etc/paths
# 當前使用者級的環境變數 
# 從前往後的順序讀取,如果/.bash_profile檔案存在,則後面的幾個檔案就會被忽略不讀了
# 如果/.bash_profile檔案不存在,才會以此類推讀取後面的檔案
~/.bash_profile   
~/.bash_login
~/.profile
# ~/.bashrc沒有上述規則,它是bash shell開啟的時候載入的
~/.bashrc

在PATH中永久新增路徑:
修改/etc/paths檔案,直接把路徑插入在檔案末尾,儲存,重啟shell