3

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?

2
  • 4
    There is no option to close and migrate to unix.stackexchange.com, but this might even be more appropriate than ServerFault. Commented Nov 17, 2011 at 14:21
  • Ah, I'm really sorry, I shall be more careful in the future. Commented Nov 17, 2011 at 15:28

1 Answer 1

4

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

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.