vim ~/.bash_profile
添加对应的环境变量
source ~/.bashrc
如果在zsh下就 open -e ~/.zshrc
如果在bash下就 open -e ~/.bash_profile
source ~/.bashrc
切换bash: chsh -s /bin/bash
切换zsh: chsh -s /bin/zsh
在终端app的系统偏好设置里手动设置。
在配置文件方面:
bash读取的配置文件:~/.bash_profile文件
zsh读取的配置文件:~/.zshrc文件
当从bash切换为zsh时,如果不想重新配置一遍.zshrc文件,可以__在.zshrc文件中加上source ~/.bash_profile,从而直接从.bash_profile文件读取配置。