Absolute and Relative Paths
Absolute Path
In this tutorial, we will learn about absolute and relative paths in Linux. The Linux file structure is hierarchical and like an inverted tree.
An absolute pathname of a file/directory is the path from the root directory(/). It is the complete path from the root directory listing all the intermediate directories.
The absolute path of the file in the Linux file structure will be unique. Any pathname that begins with the / or the ~ is an absolute pathname.
Examples
/ refers to the root directory
/home/testingdocs/Desktop
~/Desktop
The ~ is the absolute path of the user’s home directory.
/home/testingdocs is the home directory for the user. /home/testingdocs/Desktop and ~/Desktop both are same.
Relative Path
A relative pathname is the path relative from the current working directory to the file.
Examples
../ is the parent directory
../testingdocs
../../etc
—
Linux Commands Tutorial page:
https://www.testingdocs.com/linux-basic-commands-tutorial/
More Information on Ubuntu Linux:
https://ubuntu.com/