What is a dot only named folder? [duplicate]

I know what dot files or folders are, but there is a specific dot named folder (the name is just a dot) in every directories. What are they used for?

For example here is a part of my "bin" folder. Look at the first tow lines.

drwxr-xr-x  2 root root 4.0K Jul 29 12:39 .
drwxr-xr-x 23 root root 4.0K Jul 29 12:37 ..
-rwxr-xr-x  1 root root 904K Mar 30 20:02 bash
-rwxr-xr-x  1 root root  30K Aug  3  2012 bunzip2
...

Every directory contains a . and a .. entry.

. means the directory itself. It is called the current directory.

.. means the directory's parent directory, that is, the directory that contains it.

There is one directory that is not contained by any other directory: /. So / is special--like all other directories, it contains a .. entry, but its .. entry is itself. So for /, and only for /, .. and . are equivalent.

These directory entries are handy for a variety of purposes. For example, you can change directory to the parent of the directory you're currently in with the command cd ...

You may have seen . in the context of running programs or scripts. In a Unix-style shell, when you run a command by name, the shell doesn't automatically try to run a program by the name in the current directory. (This is surprising to some users coming from Windows, where traditionally that would happen.) The main reason for this is security--if someone creates a program in their directory that has the same name as some system administration tool, and you run that tool while in their directory, they could have just tricked you into running their program.

So, to run a program that is not in your PATH, you must call it by some name that has a / in it. To run a program in the current directory, you can use ./program. (You cannot use /program, because that is an absolute path and means "the file called program in the root directory, /.")


The single dot represents the current directory. The double dot represents the parent directory. Typing "cd .." will take you to the parent directory. See the bottom of this page for more information: http://www.basicconfig.com/linux/linux_cd_command_tutorial


. means the current directory.

.. means the parent directory.

So when you type cd .. , you will move one level up. When you type cp /etc/resolv.conf . , you will copy file /etc/resolv.conf in the current directory.