# Thread: Were is "cd //" documenmted ?

1. ## Re: Were is "cd //" documenmted ?

Originally Posted by helen314
Were is "cd //" documenmted ?
Code:
man path_resolution
Originally Posted by helen314
First of all it is BASH not DOS.
I did a search for: 'unix slash vs double slash'
and found this very interesting reading: https://unix.stackexchange.com/quest...rting-with-and

Bash runs on nearly every version of Unix and a few other operating systems. According to the POSIX Pathname Resolution specification:
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.
But yeh, on most OSes / and // are the same.

2. ## Re: Were is "cd //" documenmted ?

For all programmers, if you always use '/' as your directory separator, it works on all the popular OSes, including MS-Windows. Has for decades.

Every shell I've used - probably all the popular ones, but not fish, handle // anywhere in the path as a single /.

I suspect the confusion comes due to SMB, which likes \\server\path\to\something. However, if //server/path/to/something is used, that works. Whereas, \\server\path\to\something really must be entered as \\\\server\\path\\to\\something to be correct on a Unix system. On Unix, to get a single \ character, we have to escape it by using the escape character, which is almost always a single \.

\\ --> \\\\

It is just easier to use /, unless that doesn't work. But I can see where personal preference would see that as odd.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•