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 ?
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 ?
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 02 '15 at 18:10
http://askubuntu.com/usercontent/questions.php?id=604562
. It probably doesn't work with that. Anyway: It works on your terminal. ;-)
– UTF-8
Apr 02 '15 at 18:13