In this chapter
We'll learn how files and folders are organised, how to write a path to any file — absolute or relative — and what the current directory, home directory, file extensions and hidden files are.
The Problem in Real Life
Week six. A tester reports that some bookings fail on the staging server — the test copy of BlueTicket where new code is tried before customers see it. No error on the screen, just a spinning wheel.
John is in a meeting. He sends one message: "SSH into staging and tail the logs. The app log is at /var/log/blueticket/app.log."
Anna reads it three times. She knows "log" means a file where the app writes what it's doing. But "/var/log/blueticket/app.log" — is that a web address? A folder? Where even is "/var"?
It's a file. I just don't know how to get to it without a mouse.
Anna
Clicking Through Folders vs. Writing a Path
A path is an address
"/var/log/blueticket/app.log" is the full address of one file, written as a list of folders.
No mouse on a server
Servers have no file explorer to click through. You reach files by typing their paths.
Some files hide
Important files like .env are hidden by default, and names on Linux are case-sensitive.
Files, Folders and Paths
In Act 05 we saw that a file system organises everything into files (named data) and directories (folders that hold files and other folders). Directories inside directories form a tree. Now we need a way to point at any file in that tree with text. That's a path.
A path is the list of folders you walk through to reach a file, joined by a separator. Linux and Mac use a forward slash /. Windows uses a backslash \.
- Root directory — the very top of the tree. On Linux and Mac it's just
/. On Windows, each drive has its own root, likeC:\. - Absolute path — the full address starting from the root. It works from anywhere.
/var/log/blueticket/app.logmeans: start at the root, go intovar, thenlog, thenblueticket, and there's the fileapp.log. On Windows:C:\Users\Anna\Documents\notes.txt. - Current directory (also called the working directory) — the folder you are "standing in" right now. Every terminal and every program has one.
- Relative path — an address that starts from the current directory, not the root. If you're already in
/var/log, thenblueticket/app.logreaches the same file. Two special names help:.means "this folder" and..means "the folder above this one" (the parent). - Home directory — your personal folder, where your own files live. On Linux it's
/home/anna, on Mac/Users/anna, on WindowsC:\Users\Anna. On Linux and Mac you can write it simply as~.
| You are in | Absolute path | Relative path |
|---|---|---|
| / | /var/log/blueticket/app.log | var/log/blueticket/app.log |
| /var/log | /var/log/blueticket/app.log | blueticket/app.log |
| /var/log/blueticket | /var/log/blueticket/app.log | app.log (or ./app.log) |
| /home/anna | /var/log/blueticket/app.log | ../../var/log/blueticket/app.log |
The absolute path never changes. The relative path depends on where you are.
| Feature | Linux | macOS | Windows |
|---|---|---|---|
| Root | / | / | C:\ (one per drive) |
| Separator | / | / | \ |
| Home folder | /home/anna | /Users/anna | C:\Users\Anna |
| Home shortcut | ~ | ~ | %USERPROFILE% |
| Hidden files | Name starts with . | Name starts with . | A "hidden" setting |
| Case-sensitive names? | Yes | Usually no | No |
| Extension | What it usually is |
|---|---|
| .txt / .md | Plain text / Markdown notes |
| .log | A log file written by a program |
| .json / .yaml | Data or settings in a structured text format |
| .js / .ts / .py | JavaScript / TypeScript / Python source code |
| .sh | A shell script (a list of terminal commands) |
| .exe | A Windows program |
| .zip / .tar.gz | Compressed archives |
The path /var/log/blueticket/app.log, one step at a time
/
the root — top of the tree
var
data that changes
home
users' home folders
etc
system settings
log
inside var: log files
blueticket
the app's own log folder
app.log
the file Anna needs
File extensions are the letters after the last dot in a name: .log, .json, .ts, .png, .exe. They hint at what kind of file it is, so programs know how to open it. On Windows, the extension decides which app opens the file. On Linux, it's mostly just a naming habit — a file called notes with no extension is perfectly normal.
Hidden files — on Linux and Mac, any file or folder whose name starts with a dot is hidden by default: .env (settings and secrets), .gitignore, the .git folder. They're hidden to keep folders tidy, not to keep them secret — anyone with permission can still open them. Windows uses a separate "hidden" setting instead of the dot.
Case matters on Linux: App.log and app.log are two different files on a Linux server, but the same file on Windows and usually on Mac. This catches many people the first time their code moves to a server.
Permissions, from Act 05, apply to every file and folder in the tree. Being able to write a path doesn't mean you're allowed to open what's at the end of it.
Now Anna can read John's message: /var/log/blueticket/app.log is an absolute path. var is a standard Linux folder for data that changes ("variable"), log holds log files, and blueticket is the app's own folder. She knows exactly where the file is. Now she needs a way to get there.
Key Takeaway
A path is the address of a file in the folder tree. An absolute path starts at the root (/ or C:\) and works from anywhere; a relative path starts from your current directory, using . for here and .. for the parent. On Linux, names starting with a dot are hidden and upper and lower case are different.
Why This Matters
Paths are everywhere in IT: in error messages, settings files, code that reads files, server logs and every terminal command. Most "file not found" errors are just a wrong path, a wrong current directory, or a wrong capital letter. Reading a path calmly is the first step to working on any server — including BlueTicket's.
Anna knows where the log file is. To actually open it, she has to do the part she's been avoiding: open a terminal, connect to the staging server, and type.
