This question already has an answer here:

I have on occasion accidentally typed this to change to the root directory.

$ cd //

It works fine and I am in the root directory because ls returns same results as if I am on root. But why is this even valid ?

marked as duplicate by roadmr, muru, David Foerster, Eric Carvalho, Panther Apr 4 '15 at 0:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


You can add as many slashes as you want after each other at any position. It doesn't change anything.

You also can add ./ as often as you want because "." is the link from every directory to itself.

This and other acrobatics even work when you're saving files. I often will save files with names like "/tmp/a.png". The last time was about 4 minutes ago.

Try it with the address bar of your browser on any page. Same thing.

  • http://askubuntu.com////////questions/604562/why-does-the-path-exists/ gave me a HTTP 404 – Bon Ami Apr 2 '15 at 18:10
  • Ooops. There is this thing where URLs like this are chopped apart and put together to something like http://askubuntu.com/usercontent/questions.php?id=604562. It probably doesn't work with that. Anyway: It works on your terminal. ;-) – UTF-8 Apr 2 '15 at 18:13
  • If this answered your question, please mark it accordingly. – UTF-8 Apr 2 '15 at 18:47

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