Everything Lives in One Tree
No drive letters, no scattered folders — one hierarchy, starting from a single slash. Learn to read a path and you can never truly be lost.
On my old computer there was a C drive and a D drive. Where are the drives here?
There are none, in that sense. Everything — every disk, every device, every file — hangs inside one tree that starts at a single point. Once you see that, the whole system stops feeling like a maze.
One root, one tree
The root directoryRoot directoryThe single folder, written /, that everything else lives inside — the top of the one tree the whole system is arranged as. is written /. Everything lives inside it: your files, the programs, even the disks and devices themselves. There is no "other drive" — there is one tree, and every pathPathThe address of a file or folder in the system's single tree — the sequence of folders to reach it, separated by slashes. is just directions through it from some starting point.
/
|-- home/
| |-- wren/ <- your home; the shell starts you here, shown as ~
| |-- notes.txt
|-- etc/ <- system configuration lives here
|-- usr/ <- installed programs
|-- tmp/ <- scratch space, cleared on reboot
- Line 1The single slash is the top. Everything is somewhere below it — this is the whole organising idea.
- Line 3Your home directory is your own corner. The shorthand
~always means it, wherever you are. - Line 5You will meet /etc constantly: it is where a Unix system keeps its settings, as plain editable text files.
Absolute versus relative
An absolute path starts from / and spells out the whole way down: /home/wren/notes.txt. A relative path starts from wherever you are now: if you are in /home/wren, then just notes.txt means the same file. Same destination, different starting point.
# where am I?
$ pwd
/home/wren
# go into a folder (relative to here)
$ cd Documents
$ pwd
/home/wren/Documents
# ".." means the folder above. go back up one.
$ cd ..
/home/wren
# lost? "cd" with nothing always returns home.
$ cd
$ pwd
/home/wren
You are somewhere deep in the tree, confused about where, and want to get back to safety. What is the one command that always works?
cd on its own, with no destination, always takes you home. It is the reset button for "I am lost". Pair it with pwd — "where am I" — and you can always re-orient in two keystrokes. Nobody memorises the tree; they navigate it.You are in /home/wren/Documents and run `cd ..`. Where are you now?
.. means "the directory one level up", so from /home/wren/Documents you move to /home/wren. Chaining it — cd ../.. — moves up two levels. It is how you climb back toward the root.Feeling lost
- Guessing where you are
- Typing long paths by hand and mistyping them
- Not knowing how to get backAlways oriented
- pwd to ask "where am I", any time
- Tab completion so paths are never mistyped
- cd with no argument to jump home instantly
- Reading a path as directions, not memorising the mapYou do not learn the filesystem by memorising it. You learn two questions — where am I, and how do I go up or home — and the tree takes care of itself.
So there is no maze. There is one tree and two questions.
That is the whole navigation lesson. Where am I, and how do I move relative to here. Everything else is just names of folders.
Try it without the terminal
Fill in the two commands you actually need. The first prints where you are; the second takes you home from anywhere.
Show the answer
pwd then cdEach of these is a path. Sort them by whether they start from the root or from wherever you happen to be standing.
notes.txt//home/wren../logs/etc/hosts./run.sh
Show the answer
- Absolute — starts at //home/wren, /etc/hosts, /
- Relative — starts from here../logs, notes.txt, ./run.sh
Legal
Navigating your own machine is entirely yours to do. On a shared or remote system, stay within the directories and files you are authorised to access — being able to cd somewhere is not the same as being permitted to.
So the system is one tree from a single /, a path is directions through it, and you are never lost with pwd and cd. Next, we stop just looking around and start doing: creating, reading, copying and — carefully — deleting the files themselves.