我在我的 ubuntu 服务器中找到了这个目录
momo@myubuntuserver:/$ cd /
momo@myubuntuserver:/$ pwd
/
momo@myubuntuserver:/$ cd //
momo@myubuntuserver://$ pwd
//
momo@myubuntuserver://$ cd ///
momo@myubuntuserver:/$ pwd
/
为什么这个目录存在?它是如何工作的?
答案1
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'.
答案2
//
仅/
在 Linux 上。按原样///
,并且///bin//////ls
是的替代名称/bin/ls
。
键入/bin/pwd
以找出真实的当前工作目录。