Absolute Path and Relative Path

What is an Absolute Path ? 

An absolute path is a fully qualified path. Simply, the path starting from the root “/” and it specifies each an every sub directory  that goes to the destination directory. 
eg : /var/log/messages, /home/student/Videos, /etc/passwd
Like the above, absolute path starts from the root and displays all the directories along to the destination. 

What is a relative Path ? 

Not like absolute Path, relative path shows only the path necessary to reach the file from the present directory (means from the currently working directory). 
eg : Guess the absolute path of a specific file is as below.
Absolute Path : /home/student/Documents/myUrlFiles/linuxschool4you.blogspot.com
And if your present working directory is /home/student/Documents, the relative path for linuxschool4you.blogspot.com is myUrlFiles/linuxschool4you.blogspot.com. 

As a summary,
if my present directory is  /home/student/Documents
So, absolute path and relative path for file linuxschool4you.blogspot.com is as below.
Absolute path – /home/student/Documents/myUrlFiles/linuxschool4you.blogspot.com
Relative path – myUrlFiles/linuxschool4you.blogspot.com

2 thoughts on “Absolute Path and Relative Path

Leave a Reply