Linux 如何在Windows上区分Git Bash二进制文件的优先级
我在Windows构建代理上安装了Git Bash,在运行脚本时,每当我使用“find”时,它都会运行DOS find(),而不是Unix。让我的脚本在C:\Program Files\Git\usr\bin中获取find.exe的最佳方法是什么Linux 如何在Windows上区分Git Bash二进制文件的优先级,linux,cmd,path,find,git-bash,Linux,Cmd,Path,Find,Git Bash,我在Windows构建代理上安装了Git Bash,在运行脚本时,每当我使用“find”时,它都会运行DOS find(),而不是Unix。让我的脚本在C:\Program Files\Git\usr\bin中获取find.exe的最佳方法是什么 λ find /? Searches for a text string in a file or files. FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filena
λ find /?
Searches for a text string in a file or files.
FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filename[ ...]]
我必须显式地声明路径,或者在执行命令时位于bin目录中,以获取Unix样式的find
λ "c:\Program Files\Git\usr\bin\find.exe" --help
Usage: /usr/bin/find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
谢谢 我通常使用简化路径:
set G=c:\path\to\latest\git
set PATH=%G%\bin;%G%\usr\bin;%G%\mingw64\bin
set PATH=%PATH%;C:\windows\system32;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\
如果在Windows\System32
之前设置了GH
(Git安装文件夹),则将选择从Git查找,而不是默认的Windows查找
您可以键入
where find
,以检查该命令在何处找到。我通常使用简化路径:
set G=c:\path\to\latest\git
set PATH=%G%\bin;%G%\usr\bin;%G%\mingw64\bin
set PATH=%PATH%;C:\windows\system32;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\
如果在Windows\System32
之前设置了GH
(Git安装文件夹),则将选择从Git查找,而不是默认的Windows查找
您可以键入where find
,以检查该命令的位置