Linux添加环境变量

1、使用命令:vim /etc/profile

2、进入后输入i,然后添加环境变量

3、Esc退出编辑模式

4、shift + : 进入命令模式,输入wq保存退出

5、命令控制台输入命令:source /etc/profile刷新配置

6、在当前用户根目录/home/jihui下输入命令ls -a

7、修改.bashrc文件,在文件的末尾添加 source /etc/profile

原文地址:https://www.cnblogs.com/suhfj-825/p/8611857.html