mac永久配置環境變數

2021-10-08 15:30:10 字數 504 閱讀 2724

1. vim ~/.bash_profile

2. 配置別名

alias npm別名="/usr/local/bin/npm ----registry 映象源"

3.vim ~/.zshrc

在最後一行新增

source ~/.bash_profile

這樣即可完成配置永久別名

1. 啟動終端terminal

~/.bash_profile

no such file or directory

2. 進入當前使用者的home目錄

輸入cd ~

3. 建立.bash_profile

輸入touch .bash_profile

4. 編輯.bash_profile檔案

輸入open -e .bash_profile

5. 儲存檔案,關閉.bash_profile

6. 更新剛配置的環境變數

輸入source .bash_profile

mac 環境變數 配置

shell txt 可見剛剛新增的路徑被新增到了環境變數的最前面。研究了一下mac系統的環境變數,載入順序為 etc profile etc paths bash profile bash login profile bashrc 當然 etc profile和 etc paths是系統級別的,系統...

Mac 環境變數配置

環境變數修改後,重啟生效!環境變數修改後,重啟生效!環境變數修改後,重啟生效!mac 一般使用bash作為預設shell mac系統的環境變數,載入順序為 etc profile etc paths bash profile bash login profile bashrc 當然 etc prof...

Mac配置環境變數

hui mac配置環境變數 全域性 公有 配置,不管是哪個使用者,登入時都會讀取該檔案。全域性 公有 配置,bash shell執行時,不管是何種方式,都會讀取此檔案。每個使用者都可使用該檔案輸入專用於自己使用的shell資訊,當使用者登入時,該檔案僅僅執行一次 那麼當mac機器上安裝了zsh後,我...