Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After reading this question Design question: Why was '~' chosen to represent the home directory?, next obvious question on my mind was why '.' and '..' was used to represent current directory and parent directory.

It seems so intuitive now, but any particular reason?

share|improve this question
That questions has been asked and answer on SO – Stéphane Chazelas Jan 21 '13 at 16:09

I doubt you are going to find as interesting an answer as to the tilde question!

I was not there, but .. is like an ellipsis (...), which makes sense in contexts like cd ../../../there. Also, and especially looking at ye olde terminal keyboard from the tilde case, there are not many eligible characters for this purpose. You don't need to shift for ., either. It's perfect.

The fact that a dot prefix is used for hidden files might be another reason. Hidden files are not listed by default by tools such as ls, so neither are the essentially redundant . and ... Redundant in the sense that there is no point considering them along with other files -- they are certainly useful otherwise.

As it turns out I may have it backwards...from wikipedia:

The notion that filenames preceded by a '.' should be hidden is the result of a software bug in the early days of Unix. When the special '.' and '..' directory entries were added to the filesystem, it was decided that the ls command should not display them. However, the ls program was mistakenly written to exclude any file whose name started with a '.', rather than only files named '.' or '..'.

This does turn out to be useful when programming; since the system does include . and .. in response to readdir() type commands (and shell globs), ignoring them and hidden files can be accomplished the same way.

A different opinion about that use value is in the reference for the wikipedia quote. Of course, the whole story could be apocryphal...it is a little hard to believe that eg, Dennis Ritchie figured just checking for the first character would be okay.

I disagree with the author vis, it would be better to put hidden configuration files in their own directory rather than give them a universal prefix. The prefix is much more flexible, allowing for in-tree directives like .gitignore and .htaccess. Witness that files of that sort also appear together when sorted lexicographically -- so perhaps this was on purpose after all.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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