1. 程式人生 > >mac電腦bash_profile建立,開啟,編輯,儲存

mac電腦bash_profile建立,開啟,編輯,儲存

.bash_profile就像Windows下面的環境變數視窗,只不過這裡是用編輯器來控制環境變數。

 

1、建立 .bash_profile

 

啟動終端,

進入當前使用者的home目錄(預設就是):

cd ~     

 
 終端輸入
 

 touch .bash_profile


2、檢視 、編輯 .bash_profile 檔案

 

終端輸入 

 

open -e .bash_profile 

或者

open ~/.bash_profile

 編輯然後關閉


3、儲存更新剛配置的環境變數

 


  終端輸入
  source .bash_profile