Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

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

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

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

1 Answer 1

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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