编辑 .bash_profile文件
该文件时一般都会选择在当前用户目录下/Users/xxx/.bash_profile,若没有创建 .bash_profile,
- 1启动终端
- 2进入当前用户的home目录(默认就是)
— cd ~ 或 cd /Users/xxx - 3输入touch .bash_profile
编辑 .bash_profile 文件
- 1终端输入 open -e .bash_profile 编辑模式
— open .bash_profile 查看模式 - 2编辑好后输入 source .bash_profile 更新环境变量