方法1
vim /etc/profile
export PATH=$PATH:/application/nginx/sbin #添加指定路径,而不是具体文件
source /etc/profile 或 . /etc/profile
echo $PATH
方法2
在/etc/profile.d/目录下建议一个以.sh结尾的文件在里面定义 export PATH=PATH:/application/nginx/sbinsource/etc/profile或./etc/profile临时更改PATH="PATH:/application/nginx/sbin
source /etc/profile 或 . /etc/profile
临时更改
PATH="PATH:/application/nginx/sbinsource/etc/profile或./etc/profile临时更改PATH="PATH:/root"