
The absolute path contains all the necessary information about the file or directory it is describing. Therefore, the complete address of a file in the computer is referenced by the root directory. We will be using the concepts mentioned above of root and path to determine the difference between the two.Īn absolute path is a file or directory location concerning the root directory, not the current directory. Next on our list is the absolute and relative path.

Difference between absolute and relative path In short, the root directory serves as the general reference point for addressing files and directories in your computer. It contains every file and directory on your computer, including the libraries, boot files, binaries, user files, configuration settings, temporary files, and much more. The root directory sits comfortably at the very top of the Linux filesystem hierarchy. It is closely related to the PATH variable we previously mentioned therefore, a small discussion is needed. This section will expand on the root directory without getting totally lost in the details of the Filesystem Hierarchy Standard (FHS) of Linux. Now that we have covered some ground about the environmental variable PATH, we learn about the root directory to use these concepts in conjunction with our main topic. You can check the PATH variable by running the following command in the Terminal. The second one is simply the address of a directory or file in the system. Keep in mind that there is a subtle but important difference between the uppercase PATH and the lowercase path. This variable holds great significance in the operating system since it effectively increases the convenience and safety of the system.Įnvironmental variables are just a particular class of variables that hold modifiable values. PATH is an environmental variable responsible for telling the shell where to look for the programs (executable files) we want to run. That’s where the environmental variable PATH comes in. However, the shell does need to be pointed in the right direction by something to address our demands of running executables.


In Linux and other Unix-like systems, we use the command-line to run executable programs through commands. So, without any further ado, let’s get into it. What is the difference between absolute and relative PATH?.All of these are crucial to understanding the dot slash feature, and we have taken it upon ourselves to walk you through all of it. A short breakdownīefore we get into what dot backslash means in Linux, let us define some discussion points. But those who are not have come to the right place as we will be discussing this feature in great detail in this article. For those that are fond of using the command-line, slash operators will be very familiar. As Linux users, we all have to turn to the Terminal at one point or another to carry out some system tasks, whether they may have to do with installing new programs or removing old ones.
