切换shell
$chsh -s /bin/zsh
$chsh -s/bin/bash
环境配置文件
bash 的环境配置文件为:.bash_profile
zsh 的环境配置文件为:.zshrc
环境配置文件编辑
创建.bash_profile文件:
touch .bash_profile
打开.bash_profile并编辑:
open .bash_profile
写入文件:
echo 'export PATH="/usr/local/opt/node@10/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/usr/local/opt/node@10/bin:$PATH"' >> ~/.bash_profile
使修改后的配置生效命令:
source .bash_profile
source $~/.bashrc
source ~/.zshrc
source ~/.zshrc