Absolute and Relative Pathnames

Path or location in current directory tree is ether refereed to as Absolute or Relative. Lets take a look at what they are.

Absolute Path:

Absolute path also known as full or fully qualified path points to a file or directory in relation to / . When we execute pwd command we get absolute path.

$pwd
$/home/john

Command indicates that /home/john is absolute path for users john home directory. The path begins with / indicating full path.

RELATIVE PATH:

Relative path points to a file in relation to current location in directory tree.

Relative path examples:

This represents a parent directory in relation to current directory

$/home/john/cd ..

And now we can access john using relative path

$/home/cd john