Linux Path Basics
Understanding Linux Filesystem Structure
In the Linux filesystem, paths are fundamental navigation mechanisms that represent file and directory locations. The filesystem follows a hierarchical tree-like structure starting from the root directory ("/").
Root Directory and Path Types
Linux recognizes two primary path types:
Path Type |
Description |
Example |
Absolute Path |
Full path from root directory |
/home/user/documents |
Relative Path |
Path relative to current directory |
./scripts/backup.sh |
graph TD
A[Root Directory /] --> B[Home]
A --> C[Etc]
A --> D[Var]
A --> E[Usr]
Basic Path Navigation Commands
## Print current directory
pwd
## List directory contents
ls /home/user
## Change directory
cd /var/log
## Show absolute path of a command
which python3
The Linux file hierarchy standard (FHS) defines standard directories like /bin, /etc, /home, ensuring consistent system organization across different distributions.
Paths are case-sensitive in Linux, making "/Home" and "/home" distinct locations, a critical distinction for filesystem operations.