1 /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/usr/local/xxx/bin"
2 /etc/bash.bashrc
# 加入PATH export PATH=$PATH:/usr/local/xxx/bin
3 ~/bash.bashrc
# 加入PATH export PATH=$PATH:/usr/local/xxx/bin
以上要得重启以后永久生效
4 命令行1
export PATH=$PATH:/usr/local/xxx/bin
5 命令行2
PATH=$PATH:/usr/local/xxx/bin
4,5 都是临时性的,当前命令行生效