0

What is . and .. in Unix/Linux ?

I’m making a confusion here: the .. (dots) means one dot for the current directory and one dot for the parent directory? That why cd .. goes back one above? From the current to one up?

And also why the one dot and two dots is displayed this way: . .. current directory and one up? It makes more sense to me like this: .. . one up, current directory, then the files and directories…

Please explain me this a bit more.

AdminBee
  • 22,803

1 Answers1

4

Your supposition is exactly right:

  • . is the current directory.
  • .. is the parent directory, which is the typical term for the directory in which the current directory can be found.

As for why . is usually displayed before .., it has to do with lexical ordering, which is similar to alphabetization so I shall use that as an analogy: . is ordered before .. for the same reason that a would be alphabetized before aa.

DopeGhoti
  • 76,081