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

marked as duplicate by Michael Homer, heemayl, G-Man, sam, Community Jan 9 '17 at 5:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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 //////

Not the answer you're looking for? Browse other questions tagged or ask your own question.