It can be considered either.
In Linux, //
means nothing – multiple consecutive slashes get collapsed to one, anywhere in the path, including the beginning. Changing directory to //
puts you in /
, as running readlink /proc/self/cwd
would tell; likewise, /usr//local///bin
is collapsed to /usr/local/bin
.
However, some other Unix-like systems, for example Cygwin or the old Apollo Domain/OS, use the //
prefix for network paths such as //fileserver/path/to/data
. POSIX allows this as well.
For various reasons, the bash shell tracks the current directory on its own (in addition to the OS-provided tracking) and it has code in it that prevents the initial //
from being collapsed, to remain compatible with such systems. The "feature" is that bash provides more intuitive tracking of current directory, for example, when cd
'ing into a symlink, bash will show you the path you expect, even though the kernel thinks otherwise. The "bug" is that bash permits //
even on systems that do not use it.
See http://superuser.com/q/314102/91047
– Stéphane Gimenez – 2012-02-13T17:16:58.720