Linux Tutorial / File System Basics: Paths and Key Directories
The Linux file system can be understood as a single directory tree starting at /. A path identifies a location in that tree. Distinguishing an absolute path, which starts at /, from a relative path, which starts at your current working directory, helps you predict which file a command will affect. This lesson explains how to read paths and what common directories are generally used for.
One connected directory tree
Unlike the drive-letter layout familiar from Windows, Linux presents files and directories beneath one top-level directory called the root directory, written /. Another disk or file system is normally connected at a directory within this tree. That connection is called a mount. You cannot tell which physical disk holds a file merely by looking at the shape of its path.
/ and /root are different. The former is the starting point of the whole tree; the latter is commonly the root administrator account's home directory. Ordinary user home directories are often under /home/username, but account configuration can place them elsewhere.
Absolute and relative paths
An absolute path begins with /. For example, /etc/hosts refers to the same location regardless of your current directory. A relative path is interpreted from the current working directory. If that directory is /home/learner, then notes/todo.txt refers to /home/learner/notes/todo.txt.
| Notation | Meaning | Example |
|---|---|---|
/ |
Start of the file-system tree | /etc/hosts |
. |
Current directory | ./script.sh |
.. |
Parent directory | ../notes |
~ |
Expanded by the shell to the current user's home directory | ~/notes |
. and .. are directory entries used in relative paths. ~ is different: it is shell syntax, expanded before a command runs, rather than a literal file-system entry. In Bash, surrounding '~/notes' with single quotes prevents the tilde from expanding to your home directory.
Paths use / as a separator and generally distinguish uppercase from lowercase, so Notes and notes may be different names. Quote a path containing spaces, as in 'project notes', or escape the spaces so that the shell passes it as one argument.
What common directories are for
The table gives the usual purposes of locations you will encounter. Depending on the distribution and installation, a directory might be absent or linked to another location. It does not mean that every file always follows the pattern exactly.
| Path | Typical purpose |
|---|---|
/home |
Home directories for ordinary users |
/etc |
System and service configuration |
/usr |
User-space programs and shared data |
/var |
Data that changes during operation, including logs and caches |
/tmp |
Temporary files |
/dev |
Files representing devices |
/proc, /sys |
Virtual file systems exposing kernel and system information |
/boot |
Files needed for booting |
/mnt, /media |
Places commonly used to mount additional storage |
Do not casually edit or delete entries under /proc or /sys as if they were ordinary documents. Avoid keeping important data in /tmp for the long term because system policy may remove temporary files. Before changing configuration under /etc, understand the file's purpose and make a backup.
Practice reading a path
Read /home/learner/projects/report.txt from left to right. The initial / is the starting point; home, learner, and projects are directories along the way; and report.txt is the final component. A dot in the name does not prove the file's format or even that it exists.
If your current directory is /home/learner/projects, the relative path ../notes.txt refers to /home/learner/notes.txt in the parent directory. You still have to check whether that file exists. Interpreting a path and confirming its existence are separate tasks.
Before running a command, ask where you are and whether the path you entered is absolute or relative. This is especially important when moving or deleting files: a mistaken relative path can affect the wrong target. For a refresher on reading commands, see the terminal and shell basics lesson.
Official reference
The Filesystem Hierarchy Standard 3.0 describes general directory-layout conventions. Check your distribution and system configuration for the layout actually in use.









