Knowing the difference between Relative and Absolute Paths is very important and luckily very easy to understand.
A path is a road map which shows you how to get from one location on your Linux system directory tree to another.
It can uniquely identify a particular file or directory by using its Absolute or Relative position.
An Absolute Path points to a file or directory in relation to the root directory (/).
It MUST always start with a forward slash (/) in reference to the root directory.
Whenever you log in to the system, notice that it always defaults to your home directory.
This is an example of an absolute path, notice that it starts with a slash (/).
A relative path points to a file or directory in reference to your current directory location.
Let's evaluate them further:
This represents the parent directory in relation to the current working directory.
Or, simply, up one directory. This is equivalent to clicking this button in Windows:
Using the double dots in Linux:
We can reference the directory or the filename by indicating it sub-directory or filename, provided that we are presently located in the directory where that file or directory exists.
Next Topic Suggestion: