touch ~/.bash_profile; // 將目錄跳轉到.bash_profile這個文件夾
open -t ~/.bash_profile //打開.bash_profile文件
這時候會彈出一個新的窗口輸入
export PATH=$PATH:/Users/XXXXX/Applications/apache-tomcat-8.0.36/bin
保存
也有的寫:
1、打開terminal(終端)
2、cd ~ ( 進入當前用戶的home目錄)
3、open .bash_profile (打開.bash_profile文件,如果文件不存在就 創建文件:touch .bash_profile 編輯文件:open -e bash_profile)
4、直接更改彈出的.bash_profile文件內容
5、command + s 保存文件,然后關閉
6、在terminal(終端)中輸入 source .bash_profile (使用剛才更新之后的內容)
剛開始學習mac os 從網上找的一些內容。
相關鏈接:https://blog.csdn.net/smoothiemiss/article/details/51723812