In zsh, entering any number of slashes moves me into the root directory, but as I recently noticed, in bash you can cd into // and it actually displays // instead of /.

Afterwards(///.../) it all ends up in /.

Can somebody enlighten me as to what is the difference/meaning of this?

link|improve this question
4  
There is no option to close and migrate to unix.stackexchange.com, but this might even be more appropriate than ServerFault. – Bruno Nov 17 '11 at 14:21
Ah, I'm really sorry, I shall be more careful in the future. – Asmageddon Nov 17 '11 at 15:28
feedback

migrated from stackoverflow.com Nov 17 '11 at 14:22

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 4 down vote accepted

See Pathname resolution

A pathname consisting of a single slash shall resolve to the root directory of the process. A null pathname shall not be successfully resolved. A pathname that begins with two successive slashes may be interpreted in an implementation-defined manner, although more than two leading slashes shall be treated as a single slash.

Most implementations simply treat // as /, but may still show //.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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