2

On my ubuntu box I accidentally just did cd // and noticed that my current path changed to //. ls showed the contents of my root directory.

When I try cd /// (or any other number of slashes) I'm just taken directly to the root.

I'm sure this isn't something I need to worry about in any way during every day life but I was wondering if there was some interesting curiosity about why it behaves this way.

4

1 Answer 1

-1

cd / means change directory to root. The amount of slashes does not make a difference.

(source): http://www.linfo.org/cd.html

2
  • 1
    If you think a question is in the wrong place, just flag it for migration.
    – EEAA
    Commented Oct 28, 2015 at 16:32
  • (1) Your source doesn’t support your answer; it says what cd / means (which we all already know) but doesn’t say anything about cd // or multiple slashes.  (2) Something it does say is “When used without specifying any directory name, cd returns the user to the previous current directory.” — which, of course, is wrong — so it’s not a very trustworthy source. Commented Oct 31, 2015 at 4:35

Not the answer you're looking for? Browse other questions tagged .