Files, Folders and Paths

1.Where Is app.log, Exactly?

A

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.

10–12 min

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"?

A

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, like C:\.
  • Absolute path — the full address starting from the root. It works from anywhere. /var/log/blueticket/app.log means: start at the root, go into var, then log, then blueticket, and there's the file app.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, then blueticket/app.log reaches 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 Windows C:\Users\Anna. On Linux and Mac you can write it simply as ~.
Table — Absolute vs. relative paths to the same file
You are inAbsolute pathRelative path
//var/log/blueticket/app.logvar/log/blueticket/app.log
/var/log/var/log/blueticket/app.logblueticket/app.log
/var/log/blueticket/var/log/blueticket/app.logapp.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.

Table — Paths on different systems
FeatureLinuxmacOSWindows
Root//C:\ (one per drive)
Separator//\
Home folder/home/anna/Users/annaC:\Users\Anna
Home shortcut~~%USERPROFILE%
Hidden filesName starts with .Name starts with .A "hidden" setting
Case-sensitive names?YesUsually noNo
Table — Common file extensions you'll meet
ExtensionWhat it usually is
.txt / .mdPlain text / Markdown notes
.logA log file written by a program
.json / .yamlData or settings in a structured text format
.js / .ts / .pyJavaScript / TypeScript / Python source code
.shA shell script (a list of terminal commands)
.exeA Windows program
.zip / .tar.gzCompressed archives

The path /var/log/blueticket/app.log, one step at a time

/

the root — top of the tree

contains

var

data that changes

home

users' home folders

etc

system settings

go into var

log

inside var: log files

go into log

blueticket

the app's own log folder

the file

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.

Next