Open toly1994328 opened 4 years ago
可见只有source ~/.bash_profile 才能加入将环境变量
source ~/.bash_profile
其实坑点在zsh,昨天更新MacOS后,控制台提示用zsh,手贱用了一下 切回bash即可。zsh是比bash更强大shell,如有兴趣,可以自行了解。下面是两者切换方法:
zsh
bash
chsh -s /bin/bash
chsh -s /bin/zsh
在原先的.bash_profile创建.zshrc就行了,作用和.bash_profile一致,在其中配置环境路径。
.bash_profile
.zshrc
将.bash_profile复制一份,改名为. zshrc 粘贴至同目录 即可.
. zshrc
使用 echo $PATH 查看当前环境变量
chsh -s /bin/bash
chsh -s /bin/zsh
使用 zsh
在原先的
.bash_profile
创建.zshrc
就行了,作用和.bash_profile
一致,在其中配置环境路径。