Mac 打开、编辑 .bash_profile 文件


echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile source ~/.bash_profile

参考:http://mirrors.ustc.edu.cn/help/homebrew-bottles.html

或者:

1、创建 .bash_profile

1) 启动终端

 (2) 进入当前用户的home目录(默认就是): 
        cd ~3)输入touch .bash_profile

2、查看 、编辑 .bash_profile 文件

1)终端输入 open -e .bash_profile 
   (如果只是查看,直接使用open .bash_profile)

 (2)编辑

 (3)关闭即可保存修改

3、更新刚配置的环境变量

 输入source .bash_profile

一般在Mac上配置环境变量时经常要创建、编辑 .bash_profile文件。

猜你喜欢

转载自www.cnblogs.com/xkfeng/p/9335162.html