cd 到目录不起作用,但 ls 起作用 - 为什么会发生这种情况?

cd to a directory doesn't work but ls does - why is this happening?

我今天在 Windows 10 日通过 Cygwin 开始使用 fish

每当我执行

ls "G:/My Drive/"

我得到了该目录中的文件和文件夹列表,这表明它可以找到我 ls 指向的目录。

然而,当我执行

cd "G:/My Drive/"

我得到一个错误:

cd: The directory “G:/My Drive/” does not exist

我重新安装了 Cygwin 并更新了 fish,它的行为仍然相同。

为什么 cd 不起作用?

我发现了为什么会这样;也许它可以帮助遇到同样问题的其他人。

事实证明 fish 已安装到我的驱动器上,所以我没有输入

cd "G:/My Drive/"

我必须打字

cd /cygdrive/g/My\ Drive/dataSources/

更新(2019 年 3 月 27 日):

我发现 some documentation 更详细地强调了这一点。