

Note: If you observe there is no / before kernel which indicates it’s a relative directory to present working directory.Ĭhanging directory to /var/log/kernel using absolute path concept. I can use relative path concept to change directory to kernelĬhanging directory to /var/log/kernel by using relative path concept. Suppose I am located in /var/log and I want to change directory to /var/log/kernel. Relative path is defined as path related to the present working directory(pwd). If you see all these paths started from / directory which is a root directory for every Linux/Unix machines. Some examples of absolute path: /var/ ftp/pub In other words we can say absolute path is a complete path from start of actual filesystem from / directory. What Is An Absolute Path?Īn absolute path is defined as the specifying the location of a file or directory from the root directory(/). A path to a file is a combination of / and alpha-numeric characters. What Is A Path?Ī path is a unique location to a file or a folder in a file system of an OS. To understand this we have to know what is a path in Linux.

What’s the difference between absolute and relative path?

For more great SysAdmin tips and techniques check out our free intro to Linux course.

This is a classic article from the archives.
