Shell can't find nginx

允我心安 提交于 2021-01-28 06:10:35

问题


try to prompt this command nginx -V but shell returns fish: Unknown command “nginx”

If I try sudo service nginx status I could see Usage: /etc/init.d/nginx {start|stop|restart|reload|force-reload}

Why nginx -V is not work?


回答1:


/etc/init.d/nginx is a shell script to start/stop/... the nginx service

$ file /etc/init.d/nginx
/etc/init.d/nginx: POSIX shell script, ASCII text executable

nginx binary is different and usually present in /usr/sbin/. Add that directory to your PATH.

$ file /usr/sbin/nginx
/usr/sbin/nginx: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=c14e988f9696733869b790f49e27a488b0aff4c2, stripped

Or view the file /etc/init.d/nginx to find out where nginx is installed.



来源:https://stackoverflow.com/questions/36109112/shell-cant-find-nginx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!