我的 bash 可能确实识别小写和大写相同
my bash may does recognize lowercase and uppercase are same
mv readme.md README.md
然后我收到消息
'readme.md' and 'README.md' are the same file
为什么我的 ubuntu 无法识别小写和大写..?
cd
它运行良好,但是,例如我想移动 src 目录,
CD src
然后我收到消息
bash: CD: command not found
如果没有这种情况,我的bash效果很好..
环境 ubuntu 18.04
告诉我是否获得更多我的信息来解决问题。
您可能正在使用不区分大小写的 NTFS 或 VFAT 文件系统。在超级用户上查看此答案:https://superuser.com/a/431346.
但是 bash 在所有情况下都区分大小写,这就是为什么 CD
是一个未知的命令。
如评论中所述,OP 使用 OSX 作为主机,而 运行 Ubuntu 在 Docker 容器中。 Docker 在 OSX 上使用 osfx 文件系统。
Docker 文档是这样说的:
With Docker Desktop for Mac, file systems operate in containers in the
same way as they operate in macOS. If a file system on macOS is
case-insensitive, that behavior is shared by any bind mount from macOS
into a container.
还有这个:
On macOS Sierra and lower, the default file system is HFS+. On macOS
High Sierra, the default file system is APFS. Both are
case-insensitive by default but available in case-sensitive and
case-insensitive variants.
因此,您的问题的解决方案是为您的主机启用区分大小写 OS,以便为您的 Docker 虚拟机启用它。
mv readme.md README.md
然后我收到消息
'readme.md' and 'README.md' are the same file
为什么我的 ubuntu 无法识别小写和大写..?
cd
它运行良好,但是,例如我想移动 src 目录,
CD src
然后我收到消息
bash: CD: command not found
如果没有这种情况,我的bash效果很好..
环境 ubuntu 18.04 告诉我是否获得更多我的信息来解决问题。
您可能正在使用不区分大小写的 NTFS 或 VFAT 文件系统。在超级用户上查看此答案:https://superuser.com/a/431346.
但是 bash 在所有情况下都区分大小写,这就是为什么 CD
是一个未知的命令。
如评论中所述,OP 使用 OSX 作为主机,而 运行 Ubuntu 在 Docker 容器中。 Docker 在 OSX 上使用 osfx 文件系统。
Docker 文档是这样说的:
With Docker Desktop for Mac, file systems operate in containers in the same way as they operate in macOS. If a file system on macOS is case-insensitive, that behavior is shared by any bind mount from macOS into a container.
还有这个:
On macOS Sierra and lower, the default file system is HFS+. On macOS High Sierra, the default file system is APFS. Both are case-insensitive by default but available in case-sensitive and case-insensitive variants.
因此,您的问题的解决方案是为您的主机启用区分大小写 OS,以便为您的 Docker 虚拟机启用它。