Absloute path vs relative path in LinuxUnix


  Top Tutorials     New Tutorials     Submit     Login     Register  

Tutorial Detail

Absloute path vs relative path in LinuxUnix

One of this blog follower asked us that
  • Total Hits: 5765

  • Average Rating :
    URL RatingURL RatingURL RatingURL RatingURL Rating


  • Total Votes: 150 votes

  • Category: Linux/Administration

  • Submitted on: 2013-09-17 13:21:52

  • Submitted By: Surendra Anne

  • Set as Favorite


What is an absolute path?
An absolute path is defined as the specifying the location of a file or directory from the root directory(/). In other words we can say absolute path is a complete path from start of actual filesystem from / directory.

Some examples of absolute path:


If you see all these paths started from / directory which is a root directory for every Linux/Unix machines.

What is the relative path?
Relative path is defined as path related to the present working directory(pwd). Suppose I am located in /var/log and I want to change directory to /var/log/kernel. I can use relative path concept to change directory to kernel

changing directory to /var/log/kernel by using relative path concept.

cd kernel
Note: If you observe there is no / before kernel which indicates it's a relative directory to present working directory.

Changing directory to /var/log/kernel using absolute path concept.

cd /var/log/kernel
Note: We can use an absolute path from any location where as if you want to use relative path we should be present in a directory where we are going to specify relative to that present working directory.    More detail...

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 38%  57
 Two starsTwo star  Vote LeftVote MiddleVote Right 10.67%  16
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 12.67%  19
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 11.33%  17
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 27.33%  41

Caste Your Vote

 Rating  Selection  Guidelines
 Poor:     Very disappointing, useless.
 Fair:     Below average, disappointing but not useless.
 Good:     About average in its class.
 Very Good:     Above average for its category.
 Excellent:     One of the best Tutorials in its category.