linux centos 添加环境变量

所有用户全局变量

vim /etc/profile

末尾加上

export PATH=路径:$PATH   (等于号左右不能有空格)

然后

. /etc/profile

用户环境变量:

vim ~/.profile

末尾加上

export PATH=路径:$PATH(等于号左右不能有空格)

然后

. ~/.profile

原文地址:https://www.cnblogs.com/jh1994/p/6569381.html