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?

  • 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. – Llamageddon Nov 17 '11 at 15:28

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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