2

This is just trivia really, but it's just got me wondering what's going on. I accidentally hit / instead of . today and got this:

[andrew.morris@server ~]$ cd //
[andrew.morris@server //]$ pwd
/

I would have thought // was an invalid path. What happened?

0
3

For the most part, repeated slahes in a path are equivalent to a single slash. This behavior is mandated by POSIX and most applications follow suit. The exception is that “a pathname that begins with two successive slashes may be interpreted in an implementation-defined manner” (but ///foo is equivalent to /foo).

From this answer: https://unix.stackexchange.com/questions/12283/unix-difference-between-path-starting-with-and

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