解決 bash profile配置不生效的問題

2021-10-02 00:19:05 字數 306 閱讀 6242

背景:比如我在.bash_profile中設定了別名ll,每次都需要重新使用source .bash_profile才能生效。

原因:在 ~/.bash_profile 中配置環境變數, 可是每次重啟終端後配置的不生效.需要重新執行 : $source ~/.bash_profile

zsh載入的是 ~/.zshrc檔案,而 『.zshrc』 檔案中並沒有定義任務環境變數。

解決辦法:在.zshrc裡面新增一行source .bash_profile

注意:如果mac上沒有安裝.zshrc或.bash_profile檔案,需要手動新增!

bash profile等配置檔案

mysql 資料庫,裝資料用。redis 快取用。unrar 解壓用。docker 虛擬環境用。node 某些專案依賴這個。command line tools 12.4中自帶的python3.8.2 手動刪掉淘汰了的python2,用command line tools裡自帶的python pyt...

bash profile和 bashrc的什麼區別

etc profile 此檔案為系統的每個使用者設定環境資訊,當使用者第一次登入時,該檔案被執行.並從 etc profile.d目錄的配置檔案中蒐集shell的設定.etc bashrc 為每乙個執行bash shell的使用者執行此檔案.當bash shell被開啟時,該檔案被讀取.bash p...

bashrc和 bash profile的區別

etc profile 此檔案為系統的每個使用者設定環境資訊,當使用者第一次登入時,該檔案被執行。並從 etc profile.d目錄的配置檔案中蒐集shell的設定.其中的設定對所有的使用者有用 etc bashrc 為每乙個執行bash shell的使用者執行此檔案.當bash shell被開啟...