What is directory "//"?

On various linux machines you can

cd /

and

cd //

The shell will say the current directory is '/' or '//' after using the corresponding command.

So the question is: What is the difference between '/' and '//', and if the answer is 'no difference' then why is '//' shown differently than '/'

BTW

cd ///
cd ////
cd /////

All result in the shell saying the current directory is '/'

Heres an example session:

[user@host /]$ cd //
[user@host //]$ cd /
[user@host /]$ cd //
[user@host //]$ cd /
[user@host /]$

Solution 1:

Let's ask the man himself (Chester Ramey):

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'.

Solution 2:

It isn't an actual directory, it's a problem specific with bash. It's referenced in The Linux Documentation Project.