【问题标题】:Git bash: whereis command not foundGit bash:找不到whereis命令
【发布时间】:2019-06-26 09:08:46
【问题描述】:

我在 Windows 机器上使用 git bash。除whereis 命令外,一切正常。终端告诉我找不到命令:

$ whereis grep
bash: whereis: command not found

我已经尝试将 C:\Program Files(x86)\Git\bin 添加到我的 PATH 中。

我该如何解决这个问题?

【问题讨论】:

  • 我不相信 git bash 附带 whereis。它确实有 which 或者你可以使用 Windows 的 where
  • 好的,这就解释了。谢谢

标签: terminal git-bash


【解决方案1】:

在 Windows 中使用 where

在 Linux 中使用的命令 whereis 等于命令 where ,为 Windows 98 的 Windows 套件提供,并且默认包含在 Server 2003、Vista 和更新版本中:

$ where git
C:\Program Files\Git\mingw64\bin\git.exe
C:\Users\MyUser\scoop\shims\git.exe

更多信息

在 Windows 的 gitbash 中添加 .exe

虽然您想要在 gitbash 中使用 .exe 类型的可执行文件,但您应该添加以下路径关系:

 C:\Program Files\Git\mingw64\bin\<EXE>.exe

或者有 ubication 的文件夹 git 但始终应添加到 mingw64\bin\

在 Windows 中安装whereis

  • 您必须下载以下文件:whereis.zip

  • 解压后,您应该复制位于以下位置的whereis.exe 文件:

    mvp_tips/whereis/Debug/
    
  • 并将其复制到:

    C:\Program Files\Git\mingw64\bin\
    
  • 如果一切顺利,关闭所有GitBash 标签并重新打开其中一个并输入:

    $ whereis whereis
    C:\Program Files\Git\mingw64\bin\whereis.exe #And what should come out if everything is correct:
    

下载安装脚本

Git Bash 运行为Run As Administrator

#!/bin/bash
wget www.flounder.com/whereis.zip
unzip whereis.zip
cd mvp_tips/whereis/Debug/
cp whereis.exe 'C:\Program Files\Git\mingw64\bin\'
source ~/.bashrc
whereis whereis

【讨论】:

    猜你喜欢
    • 2016-06-19
    • 2022-01-19
    • 2018-05-21
    • 2016-08-16
    • 2016-01-03
    • 2018-10-19
    • 2020-10-25
    • 2015-08-26
    相关资源
    最近更新 更多