0

Due to a typo, I accidentally cd into //. Which turns out to be a real directory (but same content as /)

So what is the difference between / and // (despite having identical content)


Real example: (ls output shortened for brevity)

:/$ cd /
:/$ ls
bin  boot  dev  etc ...
:/$ cd //
://$ ls
bin  boot  dev  etc ...
://$ cd //////// 
:/$ ls (notice how it entered `/` and not `//`)
bin  boot  dev  etc ...
:/$

So from the test above it seems that // is a special directory. This appears to be only bash, zsh did not have this quirk. Also //etc, //var, etc; all appear to be valid

1 Answers1

0

You are cd'ing into the same dir. Multiple slashes are ignored.

cd /

will take you to the same (in this case root) dir as

cd //

or

cd //////
MERM
  • 188