Paths in Linux


Relative Path and Absolute Path

Relative Path- A relative path is a path where we are now (Current directory). A relative path uses a single dot (.) to signify the current directory and double dots (..) to signify the parent directory of the current directory.

E.g. ls ./
Now ./ command will list all files/directories present in the current directory.

E.g. ls ../

Now ../ command will list the name of the parent directory of the current directory.
Absolute Path- Absolute path or full path is the entire directory structure, starting from the root directory. We can recognize the absolute path if it contains / character at the beginning.

E.g. ls /home/abc