方法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:/application/nginx/sbinsource/etc/profile或./etc/profile临时更改PATH="PATH:/root"