What is a file path?
Your computer has hundreds of thousands of files. When you want a specific one, you can’t just say “the photo.” You have to give the computer an address.
That address is called a path.
How an address works
Think about how you’d describe where a book is in a library:
Second floor → History section → Shelf 14 → third book from the left.
Each step narrows things down until you’re pointing at exactly one book. A file path is the same — folder, then folder inside it, then folder inside that, then finally the file:
Documents/work/2025/report.pdf
Read it left to right:
- Start in a folder called
Documents. - Inside it, open
work. - Inside that, open
2025. - There’s a file called
report.pdf. That’s the one.
The / between each piece is the separator. It just means “now go inside this one.”
Slashes: which way?
You’ll see two:
- Forward slash
/— used on Mac, Linux, the web, and most documentation. - Backslash
\— used in old Windows paths and File Explorer’s address bar.
Modern Windows accepts both. This course uses forward slashes everywhere, and so does every terminal you’ll actually use (including Windows’ newer ones).
What a real path looks like
On different operating systems, the very start of a path differs:
Mac: /Users/you/Documents/report.pdf
Linux: /home/you/Documents/report.pdf
Windows: C:\Users\you\Documents\report.pdf
Different roots, same idea: a chain of folders ending in a file.
You already use paths
Every time you click a folder, then a folder, then a file in Finder or File Explorer — you’re walking a path. The terminal just makes you write down what your mouse was doing.
That’s not a downgrade. Once you can write a path, you can hand it to any command. “Do this to that file.” “Copy this folder to here.” A typed path works on a thousand files at once. A mouse click works on one.
What’s next
Paths point at files. But what kind of file is at the end of the path? That’s usually written into the path itself, in the bit after the last dot — the extension. That’s next.