Categories
Linux Tutorial Series

Linux Tutorial Series – 22 – Absolute and relative pathnames

Here is the video version, if you prefer it:

When talking about paths, you can often hear “absolute path” or “relative path”. What do these mean?

Absolute path is a path which starts from the root directory of your Linux system. (Barrett, 2016)⁠ So an absolute path would be something like:

/home/mislav

Relative paths are relative to the directory you are currently in (the so called working directory). So, if I wanted to use the cd command (which allows me to change directories (“cd(1) – Linux man page,” n.d.)⁠):

mislav@mislavovo-racunalo:~$ cd SomeFolder

I would go from ~ (which is a shorthand for /home/mislav) to SomeFolder, not from the root directory (denoted by /) to SomeFolder.

Hope this was useful!

References

Barrett, D. J. (2016). Linux pocket guide (3rd ed.). O’Reilly Media. Page 18

cd(1) – Linux man page. (n.d.). Retrieved January 5, 2020, from https://linux.die.net/man/1/cd