1.切换到~ cd ~ 2.编辑/etc/bashrc vi /etc/bashrc/ 3.添加环境变量 在 /etc/bashrc中追加nginx命令的绝对路径export PATH=$PATH:/usr/local/nginx/sbin末尾加上这句,然后source /etc/bashrc