The Filesystem Is a Tree
What this is. Every file on the machine lives in exactly one place in a single tree. The tree starts at /, called the root, and everything hangs beneath it.
A path is the address of a place in that tree, written as names separated by slashes.
Two ways to write an address, and the distinction matters constantly.
An absolute path starts at the root, so it begins with /. /home/learner/projects means the same thing no matter where you currently stand.
A relative path starts from wherever you are now. projects means the projects directory inside the current one, so its meaning changes as you move.
Three shorthands you will use every day.
. is the current directory.
.. is the parent, one level up.
~ is your home directory.
So ../map means go up one level then into map, and ~/projects means the projects directory inside your home no matter where you are.
Mark this lesson complete
Signed in, your progress follows you to every device.