mac添加bash_profile环境变量

简介: mac添加bash_profile环境变量

mac的环境变量

a. /etc/profile 
b. /etc/paths 
c. ~/.bash_profile 
d. ~/.bash_login 
e. ~/.profile 
f. ~/.bashrc 

其中

a和b是系统级别

c,d,e按照从前往后的顺序读取

如果c文件存在,则后面的几个文件就会被忽略不读了

~/.bashrc没有上述规则,bash shell打开的时候载入

建议在c中添加环境变量

修改

vim ~/.bash_profile

export MAVEN_HOME=/usr/local/apache-maven-3.6.0

export PATH=$PATH:$MAVEN_HOME

生效

source ~/.bash_profile

参考

mac下添加环境变量

            </div>
目录
相关文章
|
2月前
Mac每次都要执行source ~/.bash_profile配置的环境变量才生效
Mac每次都要执行source ~/.bash_profile配置的环境变量才生效
112 2
|
5月前
|
关系型数据库 MySQL iOS开发
干货文:Mac 中 .bash_profile 和 .zshrc 的区别
干货文:Mac 中 .bash_profile 和 .zshrc 的区别
1065 1
|
5月前
|
存储 Shell Linux
Linux(27) profile和bashrc的区别
Linux(27) profile和bashrc的区别
49 0
|
11月前
|
Shell iOS开发 MacOS
mac ~/.bash_profile 重启失效
mac ~/.bash_profile 重启失效
142 0
|
Shell Linux Go
Linux profile1,bashrc,.bash_profile,.bash_login,.profile,.bashrc,.bash_logout浅析 Part1
Linux profile1,bashrc,.bash_profile,.bash_login,.profile,.bashrc,.bash_logout浅析 Part1
100 0
|
Shell 开发工具
mac添加bash_profile环境变量
mac添加bash_profile环境变量
207 0
|
Shell
MAC修改.bashrc/.bash_profile无效,默认的用户配置文件是.zshrc,
MAC修改.bashrc/.bash_profile无效,默认的用户配置文件是.zshrc,
307 0
|
存储 Shell Linux
linux bash环境变量简单总结
来源链接:http://www.178linux.com/8005 原创文章,如有转载,请注明原文地址 一.环境变量简介 Linux是一个多用户的操作系统。每个用户登录系统后,都会有一个专用的运行环境。
1328 0