3

Я нашел этот каталог в моем сервере Ubuntu

momo@myubuntuserver:/$ cd /
momo@myubuntuserver:/$ pwd
/
momo@myubuntuserver:/$ cd //
momo@myubuntuserver://$ pwd
//
momo@myubuntuserver://$ cd ///
momo@myubuntuserver:/$ pwd
/

почему этот каталог существует? Как это работает ?

2 ответа2

9

Из 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'.
5

// это просто / на Linux. Как и /// , и ///bin//////ls - это альтернативное имя для /bin/ls .

Введите /bin/pwd чтобы узнать настоящий настоящий рабочий каталог.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками .