原文:Mac配置.bash_profile,重啟終端后配置失效

場景 在Mac中使用mongodb,一般都要在.bash profile中配置一下環境變量,后面使用會比較方便一點。遇到的問題狀況是:配置.bash profile后,source了一下,然后啟動了mongodb,這時又新建了一個終端窗口去連接數據庫,去執行mongo命令,提醒: 原因 使用的終端是zsh,zsh加載的是 .zshrc文件,而 .zshrc 文件中並沒有定義任務環境變量 解決 終端 ...

2019-12-10 13:31 0 2018 推薦指數:

查看詳情

[MAC] 終端bash_profile配置不生效問題

MAC設置環境變量時, 配置bash_profile 沒有生效,需要手動執行下面命令才生效。   source ~/.bash_profile 原因:zsh和bash有別, zsh模式不執行上述腳本,bash模式才執行。 zsh、bash 模式互相切換 切換bash ...

Sun Feb 21 02:02:00 CST 2021 0 1074
mac ~/.bash_profile配置重啟不生效的解決方法

轉載自:https://www.jianshu.com/p/d16472647ff3 自己在 ~/.bash_profile配置環境變量, 可是每次重啟終端配置的不生效.需要重新執行 : $source ~/.bash_profile 發現zsh加載的是 ~/.zshrc文件 ...

Tue Aug 25 00:53:00 CST 2020 0 1274
bash_profile 配置

1、打開Terminal(終端) 2、輸入:vi ~/.bash_profile 3、設置PATH:export PATH=/mongodb/bin:$PATH 4、輸入::wq //保存並退出vi 5、修改立即生效:source ~/.bash_profile ...

Sat Apr 20 19:45:00 CST 2019 0 6338
bash_profile 配置生效

1、打開Terminal(終端) 2、輸入:vi ~/.bash_profile 3、設置PATH:export PATH=/mongodb/bin:$PATH 4、輸入::wq //保存並退出vi 5、修改立即生效:source ~/.bash_profile 6、查看環境變量 ...

Tue Oct 12 16:46:00 CST 2021 0 3948
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM