I was working in my terminal, when I misspelled while cd
to root (/
). Accidentally, I typed //
and I got in terminal:
root@weblocalhost://#
When i type pwd
, i get response //
but when I type ls -s
i got same list as in /
directory.
When you type more than 2, i.e. ///
you get:
root@weblocalhost:/#
Always 1 /
except for 2. Is there any difference and what is //
for?
Best Answer
/
is equivalent to//
From the POSIX specification (emphasis added):
And:
For a nice discussion of exceptions (cygwin and directories) see: How does linux handle multiple consecutive path separators (/home////username///file)?