Understanding absolute path and relative path in linux operating system is a essential point if you are in a beginner level. Since we need to have a clear understanding about the linux file path navigation, we have to get this absolute path and relative path understandable very well.
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.
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
So, from this article i guess you got the useful of learning this speacial topic. It helps for your daily linux operations. This simplifies your taks and saves time.