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

Whenever you type ls -a into the command prompt, you usually get all of your folders, files, and then you see that the first two entries are . and ..

Just curious, but what is the significance of these two entries?

share|improve this question
To not list . and .. you can use ls -A. – Nykakin Apr 24 '13 at 12:01
Note that they are not necessarily the first ones, it just so happens that the . character, in most locales, sorts before the characters usually used as the first character of a file name (but there still are plenty of characters that sort before .). – Stéphane Chazelas Jan 2 at 21:48
up vote 14 down vote accepted

. is the relative reference for the current directory.
.. is the relative reference for the parent directory.

This is why cd .. makes the parent directory the new working directory.

share|improve this answer
This also explains the ./ that you have to type when you want to run a executable from the current directory. It's the equivalent to typing /the/full/path/to/the/executable. (had one of these "ahh" moments when I realized that :) ) – alextsc Oct 1 '11 at 19:58
In most cases "." and ".." are also absolute references to the corresponding INODE (or other internal structure element of the used filesystem) of the current or "below" directory. – Nils Oct 1 '11 at 20:53
one exception to this rule is the root dir / where . and .. both point to the current dir. – Sirex Oct 3 '11 at 6:55
Sirex's comment is important because it's what allows you to ../../../../../../../../../../../../../../.. for as long as you want and not break anything. – Dason Oct 31 '11 at 5:19

. and .. are hard links to the current and the parent directory (/ is the parent of itself).

With the -a option ls shows all inodes in the current directory, i.e. also the hidden files which filenames begin with ad dot, therefore . and .. are shown.

share|improve this answer
Well, my question is duplicate. In the link that you posted, there is an answer for my question. Thanks by the way. – yfklon Apr 24 '13 at 11:57

you must be knowing that Directory is nothing but a file that points to some list of files, basically it is a pointer, may be hidden or not. in similar way . and .. are the pointer which point to Uppermost directory and upper directory respectively. that is why i think when we execute

ls -a

command, these are displayed!

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.