linux通过export添加环境变量,linuxexport


方式一,只能在当前会话临时生效

PATH=/usr/local/openresty/sbin:$PATH
export PATH

方式二,永久有效

vi /etc/profile

添加export PATH=$PATH:/usr/local/openresty/bin到文件末尾,并使之生效

source /etc/profile

 

 

之后便可以直接执行nginx等命令

nginx -p `pwd` -c conf/nginx.conf -s stop

 

相关内容

    暂无相关文章