手动添加系统环境变量

方法1
vim /etc/profile
export PATH=$PATH:/application/nginx/sbin #添加指定路径,而不是具体文件
source /etc/profile 或 . /etc/profile
echo $PATH

方法2
在/etc/profile.d/目录下建议一个以.sh结尾的文件在里面定义 export PATH= P A T H : / a p p l i c a t i o n / n g i n x / s b i n s o u r c e / e t c / p r o f i l e . / e t c / p r o f i l e P A T H = " PATH:/application/nginx/sbin source /etc/profile 或 . /etc/profile 临时更改 PATH=" PATH:/root"

猜你喜欢

转载自blog.csdn.net/bjgaocp/article/details/90171858