Ubuntu20.04LTS 添加环境变量

查看已有的变量

echo $PATH

添加环境变量

# 进入etc目录
cd /etc
# 编辑profile
vim profile

# 例如在后面添加一行
export PATH=/root/.composer/vendor/bin:$PATH

使刚刚添加的环境变量生效

# 进入etc目录
cd /etc
# 执行
source profile
原文地址:https://www.cnblogs.com/kousum/p/14326216.html