Absolute and Relative Paths

Path Separator

  • First off: in UNIX, the path separator is the forward slash: / (as opposed to Doze which chose the backslash, \)

Relative Paths

  • Don’t begin with a /

  • Interpreted relative to the current working directory (CWD)

Being in my home directory, change into the Documents subdirectory of it
$ pwd
/home/jfasch
$ cd Documents
$ pwd
/home/jfasch/Documents
From there, change into its neighbor directory, Downloads
$ cd ../Downloads
$ pwd
/home/jfasch/Downloads

Absolute Paths

  • Start with a /

  • “Relative” to the root directory

  • ⟶ Independent of CWD

$ cd /etc
$ pwd
/etc