问题描述
尝试提示这个命令 nginx -V
但 shell 返回 fish: Unknown command nginx"
try to prompt this command nginx -V
but shell returns fish: Unknown command "nginx"
如果我尝试 sudo service nginx status
我可以看到 Usage:/etc/init.d/nginx {start|stop|restart|reload|force-reload}
If I try sudo service nginx status
I could see Usage: /etc/init.d/nginx {start|stop|restart|reload|force-reload}
为什么 nginx -V
不起作用?
推荐答案
/etc/init.d/nginx
是一个用于 start/stop/...
的 shell 脚本> nginx 服务
/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
二进制文件不同,通常出现在 /usr/sbin/
中.将该目录添加到您的 PATH
.
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
或者查看文件/etc/init.d/nginx
,找出nginx的安装位置.
Or view the file /etc/init.d/nginx
to find out where nginx is installed.
这篇关于Shell找不到nginx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!