【发布时间】:2019-06-26 09:08:46
【问题描述】:
我在 Windows 机器上使用 git bash。除whereis 命令外,一切正常。终端告诉我找不到命令:
$ whereis grep
bash: whereis: command not found
我已经尝试将 C:\Program Files(x86)\Git\bin 添加到我的 PATH 中。
我该如何解决这个问题?
【问题讨论】:
我在 Windows 机器上使用 git bash。除whereis 命令外,一切正常。终端告诉我找不到命令:
$ whereis grep
bash: whereis: command not found
我已经尝试将 C:\Program Files(x86)\Git\bin 添加到我的 PATH 中。
我该如何解决这个问题?
【问题讨论】:
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
虽然您想要在 gitbash 中使用 .exe 类型的可执行文件,但您应该添加以下路径关系:
C:\Program Files\Git\mingw64\bin\<EXE>.exe
或者有 ubication 的文件夹 git 但始终应添加到 mingw64\bin\。
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
【讨论】: