Git bash:whereis命令未找到

5

我在Windows机器上使用Git Bash。除了whereis命令之外,一切正常。终端告诉我找不到该命令:

$ whereis grep
bash: whereis: command not found

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

我该如何解决这个问题?


2
我不相信git bash会附带whereis。它确实有which,或者你可以使用Windows的where - cody
好的,那就解释了。谢谢。 - BradB
1个回答

4

在Windows中使用where

在Linux中使用whereis命令相当于在Windows中使用where命令,该命令是Windows 98套件提供的,并且在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

如果您的计算机上有 git 文件夹,但它始终应添加到 mingw64\bin\ 中。

在Windows中安装whereis

  • You must download the following file:whereis.zip

  • Once unzipped, you should copy the whereis.exe file that is in :

    mvp_tips/whereis/Debug/
    
  • And copy it in :

    C:\Program Files\Git\mingw64\bin\
    
  • If all went well, close all the GitBash tabs and reopen one of them and enter :

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

下载和安装脚本

以管理员身份运行Git Bash

#!/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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接