【问题标题】:locate apache2ctl找到 apache2ctl
【发布时间】:2011-10-15 15:36:48
【问题描述】:

我可以说 apache2ctl 优雅,我的网络服务器在交互式 shell 中重新启动。一切都很好。但是,我需要在 shell 脚本中说明这一点,所以我需要 apache2ctl 的完整路径。我已经尝试了 which 和 locate,但没有任何结果,这让我感到非常惊讶。我查看了 /usr/bin 并没有 apache2ctl。我如何确定它在哪里?

我想也许它会在 /opt/local/apache2/bin 中,但那里有一个 apachectl...不是 apache2ctl。我难住了。有什么想法吗?

@Jon Lin - 干得好...输入 apache2ctl 告诉我 apache2ctl is aliased tosudo /opt/local/apache2/bin/apachectl'` 。非常感谢。

【问题讨论】:

    标签: apache apache2 webserver


    【解决方案1】:

    它应该在 /usr/sbin 或 /usr/local/sbin 中

    【讨论】:

      【解决方案2】:

      您可能需要在 locate 之前运行 updatedb 以防万一

      $ updatedb
      # takes a while
      
      $ locate apache2ctl
      

      或者你可以运行find / -name 'apache2ctl' 2> /dev/null 来搜索你的整个分区

      【讨论】:

      • 我在 Mac 上并且更新后不起作用。我尝试了 find 命令,它只是挂在我的终端中。
      • 哦,你的屏幕右上角有取景器吗?你试过通过那个搜索吗?
      【解决方案3】:

      你试过which吗? (不确定它是否会出现在 Mac 上,尽管它在大多数 *nix 系统上是相当标准的;在 Windows 上的行为很像 where)。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-07-28
        • 1970-01-01
        • 2021-11-15
        • 1970-01-01
        • 2021-08-29
        • 2019-07-23
        • 2021-06-19
        • 1970-01-01
        相关资源
        最近更新 更多