What Is Double Dot (..) And Single Dot (.) In Linux?

In Linux, the single dot (.) and double dot (..) are special directory references that appear in every directory. The single dot represents the current directory, while the double dot represents the parent directory. These symbols are fundamental for navigation and file operations in the Linux file system.

Understanding Single Dot (.) and Double Dot (..)

Every directory in Linux contains two special entries that are automatically created by the file system

$ ls -la
total 892
drwxr-xr-x 122 tutorial article   48 18 Dec 05:07 .
drwxr-xr-x  54 tutorial article 4096 16 Dec 04:03 ..
-rw-rw-rw-  19 tutorial article  960 02 Dec 09:57 operations

In this output, the first entry . refers to the current directory itself, and .. refers to the parent directory one level up in the directory hierarchy.

Using Single Dot (.) in File Operations

The single dot is commonly used in file operations to reference the current directory. Here's an example of copying files to the current directory

$ cp /tmp/*.cfg .
$ pwd
$ ls
/home/user/current_dir
sample.cfg Read.cfg figures.cfg
modules.cfg linux_tut.cfg fedora_23.cfg

Note The space between the source path and the dot is essential. The dot tells the cp command to copy files to the current working directory.

Creating Hidden Files and Directories

Files and directories that start with a dot are treated as hidden in Linux. They won't appear in normal directory listings unless specifically requested.

Creating Hidden Files

$ touch .confidential.py
$ mkdir .hidden_directory
$ touch visible_file.txt

Viewing Hidden Files

Regular ls command shows only visible files

$ ls -l
-rw-rw-r-- 1 article article 0 Dec 25 12:00 visible_file.txt

Using ls -a reveals all files, including hidden ones

$ ls -al
drwxrwxrwx 1 article article 512 Dec 4 11:53 .
drwxr-xr-x 1 article article 512 Dec 3 17:09 ..
-rw-rw-r-- 1 article article   0 Dec 3 02:35 .confidential.py
drwxrwxrwx 1 article article 512 Dec 3 22:37 .hidden_directory
-rw-rw-r-- 1 article article   0 Dec 4 01:34 visible_file.txt

Directory Navigation with Double Dot (..)

The double dot is essential for navigating up the directory tree using the cd command.

Single Level Navigation

$ pwd
/home/tutorials/linux_files/tmp
$ cd ..
$ pwd
/home/tutorials/linux_files

Multiple Level Navigation

$ cd ../..
$ pwd
/home/tutorials

You can also combine .. with specific directory names to navigate efficiently

$ cd ../other_directory
$ cd ../../parent/sibling_directory

Common Use Cases

Symbol Meaning Example Usage
. Current directory cp file.txt .
.. Parent directory cd ..
.filename Hidden file .bashrc, .gitignore

Conclusion

The single dot (.) and double dot (..) are fundamental navigation tools in Linux. The single dot represents the current directory and is used in file operations and creating hidden files, while the double dot represents the parent directory and enables upward navigation in the directory hierarchy. Understanding these concepts is essential for effective Linux command-line usage.

Updated on: 2026-03-17T09:01:38+05:30

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements