我们知道根目录是/,根据posix,还有另一个与/不同的目录//。当您 ls / 和 ls // 时,输出是相同的,就像 stat 一样,但是如果您 cd / 和 cd // ,它们是不同的,尽管目录内容相同。
这真的让我很困惑。有人得到答案吗?
From Bash FAQ http://tiswww.case.edu/php/chet/bash/FAQ:
E10) Why does `cd //' leave $PWD as `//'?
POSIX.2, in its description of `cd', says that *three* or more leading
slashes may be replaced with a single slash when canonicalizing the
current working directory.
This is, I presume, for historical compatibility. Certain versions of
Unix, and early network file systems, used paths of the form
//hostname/path to access `path' on server `hostname'.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)