File paths on a Mac, explained simply
A file path is one of those things that looks like a secret code until someone shows you the pattern, and then it never looks confusing again. If you have ever seen a line like /Users/sam/Documents/report.pdf and skated past it, this is the guide that makes it plain. Paths turn up the moment you touch a terminal, edit a config file, or follow setup instructions, so a clear picture of them pays off quickly.
What a file path actually is
A path is an address for a file. It tells the Mac exactly where a file lives by naming every folder you would open to reach it, in order, from the outside in.
Think about how you would tell someone to find a document by hand. Open the disk, open the Users folder, open your account folder, open Documents, and there is the file. A path is that same set of directions written on one line, with each folder separated by a slash. /Users/sam/Documents/report.pdf means: start at the top, go into Users, then into sam, then into Documents, and there sits report.pdf.
Because a path names every step, there is no ambiguity. Two files can both be called report.pdf, but if they sit in different folders their paths differ, so the Mac always knows which one you mean.
The pieces of a path
A path is built from a few simple parts, and once you can name them the whole thing reads easily.
The first slash is the root. A single / at the very start means the top of the disk, the outermost level that contains everything else. Every absolute path begins there.
The words between slashes are folders, listed from the outside in. Each slash means step into the next folder. The last item, after the final slash, is usually the file itself, including its extension like .pdf or .png.
Your home folder gets a shortcut of its own: the tilde, ~. It stands for /Users/ followed by your account name. So ~/Documents/report.pdf and /Users/sam/Documents/report.pdf point at the same file when your account is sam. The tilde saves typing and, more importantly, makes instructions work for anyone regardless of their account name.
Absolute paths and relative paths
Paths come in two styles, and the difference is only about where they start counting.
An absolute path starts from the root or from your home folder, so it works no matter where you currently are. /Users/sam/Documents/report.pdf is absolute. It is the full address, complete on its own.
A relative path starts from wherever you happen to be right now, often called the current folder. If you are already sitting in /Users/sam/Documents, then report.pdf on its own is enough, because it is understood relative to that spot. You also see .. used to mean the folder one level up, so ../Pictures means leave the current folder and go into Pictures beside it.
Absolute paths are safest when you want something to work everywhere. Relative paths are shorter and are handy inside a project where everything sits together.
Spaces, and why paths sometimes have backslashes
Folder and file names on a Mac can contain spaces, and those spaces cause a specific hiccup on the command line. A terminal reads a space as the end of one item and the start of the next. So My Reports looks like two things to it, not one folder.
There are two common fixes. You can wrap the whole path in quotation marks, like "/Users/sam/My Reports/report.pdf", which keeps it as a single item. Or you can put a backslash before each space, which is why you sometimes see My\ Reports. The backslash tells the terminal to treat the next space as part of the name rather than a separator. Both do the same job. The quotes are usually easier to read.
How to get a file’s path quickly
You rarely need to type a path by hand. macOS will give you the exact text.
In Finder, right-click the file, then hold the Option key, and Copy becomes Copy as Pathname. That places the full path on the clipboard, ready to paste. It is the fastest way to get an exact path without a typo.
You can also drag a file straight into a terminal window. The terminal fills in the full path for you, spaces escaped and all, so you can carry on typing the rest of your command.
And if you just want to read a path, select a file in Finder and press Command-I for Get Info. The Where line shows the folder it lives in.
When a path is what an app needs
Some destinations only want the path, not the file. A terminal is the clearest example: it works in text, so to point a command at a file you feed it the file’s path as characters.
This is where a shelf earns its place. Ledge lets you park a file at the notch, then drop it wherever it needs to go. Drop it on a terminal and Ledge hands over the path as text, the exact form the command line wants, so you skip the copy-as-pathname dance. Drop the same file on Finder instead and it moves the file itself. The path is just one of the forms your file can take, and knowing what a path is makes it obvious why different apps ask for different things.