3.2 Relative and Absolute Paths

When talking about file locations, a path tells us where a file lives within a directory structure. Paths can be absolute or relative. In general, relative paths are preferrable for reproducibility.

Absolute paths

Absolute paths tell us the location of a file relative to the whole directory structure. Using the previous example, the absolute path of biol-125_research-project_notes.docx is /Users/yourUserName/Desktop/BIOL-125/Research-Project/.

Relative paths

Relative paths on the other hand tell us the location of a file relative a working directory. So, if you’re working directory is your Desktop, the relative path of biol-125_research-project_notes.docx is BIOL-125/Research-Project.