我可以说apache2ctl优雅,我的web服务器在交互式shell上重启。一切都很好。但是,我需要说在shell脚本中,所以我需要apache2ctl的完整路径。我已经尝试了哪个并找到但没有任何事情发生,这让我非常惊讶。我查看了/ usr / bin并且没有apache2ctl。我怎么知道它住在哪里?
我想也许它会在/ opt / local / apache2 / bin中,但是那里有一个apachectl ...而不是apache2ctl。我很难过。有什么想法吗?
apache2ctl is aliased to
sudo / opt / local / apache2 / bin / apachectl'`。非常感谢你。
答案 0 :(得分:1)
应该在/ usr / sbin或/ usr / local / sbin
中答案 1 :(得分:0)
您可能需要在updatedb
之前运行locate
以防万一
$ updatedb
# takes a while
$ locate apache2ctl
或者您可以运行find / -name 'apache2ctl' 2> /dev/null
来搜索整个分区
答案 2 :(得分:0)
你试过which
吗? (不确定Mac上是否存在这种情况,尽管它在大多数* nix系统上非常标准;在Windows上的行为与where
相似。)