windows-7 - 我可以通过 Git Bash 使该位置在 Windows 上运行吗?

标签 windows-7 git-bash

Git Bash 似乎对各种 Linux 命令都有很好的支持。它甚至支持定位,尽管它从来没有找到任何东西:

mypc@mypc MINGW64 ~
$ locate --regex .*?\/[^\/]+\.docx

我尝试更新定位数据库,但支持尚未完成:

mypc@mypc MINGW64 ~
$ updatedb
/usr/bin/updatedb: line 323: /usr/var/locatedb.n: No such file or directory
Failed to generate /usr/var/locatedb.n

我可以通过编辑一些脚本来解决这个问题吗?是什么原因导致这个问题?

最佳答案

从 git bash 运行:

mkdir /c/Program\ Files/Git/usr/var; updatedb --localpaths='/c/'

您还可以在 ~/.bash_profile 中添加以下别名:

alias updatedb="updatedb --localpaths='/c/'"

我还没有尝试过别名,但我不明白为什么它会起作用。

只需确保其中之一

source ~/.bash_profile

或者在添加别名后打开一个新 shell,以便加载它。

关于windows-7 - 我可以通过 Git Bash 使该位置在 Windows 上运行吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36841241/

相关文章:

git - 使用 "git checkout"时修改后的文件会发生什么?

git - 如何使用 bash 脚本遍历所有 git 分支

java - 为什么我的程序不能删除它在Win7下创建的文件?

node.js - 用于通过 SSH 进行 node.js 开发的良好 Windows 7 IDE

Git Bash 打开命令窗口

windows - 如何在 Windows 上将 man 和 zip 添加到 "git bash"安装

java - 如何将 URL 参数从 Java 传递到 Windows 7 中的本地 HTML 文件?

python - 是否可以在 python 中检测是否有东西插入音频插孔?

c# - C# 开发中可能存在的 64 位操作系统问题

linux - 如何在启动 git bash 终端之前运行 linux 命令