# File Path

> The address of a file. It lists each folder from the top, then the file.

**Field:** Software Development  
**Category:** Platforms & OS  
**Also known as:** Path, Filepath, File Location

## Think of it like

Think of it like a street address. Country, town, street, then house number.

## Definition

A file path is the address of a file. It lists each folder from the top down to the file. On Linux and macOS, the parts are split by a forward slash. On Windows, they are split by a backslash and start with a drive letter. A path from the root is absolute. A path from the folder you are in is relative.

## Example

Emma's notes sit at the path shown below. From inside her own folder, she can type just notes.txt.

## Example code

```console
$ cat /home/emma/notes.txt
Buy milk
```

An absolute path, from the root down to the file.

## Why it matters

Programs find every file by its path. A wrong slash or one missing folder means file not found.

## Common mistake

Typing a path with backslashes into Linux code. Use forward slashes, or a library that builds paths for each system.

## Three principles

- **Top down.** Each folder in order, then the file.
- **Slashes differ.** Forward on Linux and Mac, back on Windows.
- **Absolute or relative.** From the root, or from where you are.

## Related terms

- [Directory](https://learn.benibix.com/term/development/directory)
- [File System](https://learn.benibix.com/term/development/file-system)
- [Working Directory](https://learn.benibix.com/term/development/working-directory)
- [Cross-Platform](https://learn.benibix.com/term/development/cross-platform)
- [Microsoft Windows](https://learn.benibix.com/term/development/windows)

## Taught in

- [File Paths and Folders](https://learn.benibix.com/learn/development-platforms/file-paths-and-folders): OS and Files, 9/10
- [The Linux File Tree](https://learn.benibix.com/learn/infrastructure-linux/linux-file-tree): Linux CLI, 4/10

![A tree of boxes. The root, a slash, holds home and etc. Home holds emma and jack. Emma holds two files, notes.txt and photo.png. The boxes from the root to notes.txt are lit up. Under the tree, the path to that file is written out twice: /home/emma/notes.txt on Linux and macOS, and C:\Users\Emma\notes.txt on Windows.](https://learn.benibix.com/diagrams/dev-file-tree.svg)

---

Source: https://learn.benibix.com/term/development/file-path
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
