You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Everything in Linux is a file — regular files, directories, devices, and even processes are represented in the filesystem. Understanding how the filesystem is organised and how to navigate it is the first essential skill.
Linux follows the Filesystem Hierarchy Standard, which defines a consistent directory structure:
| Directory | Purpose |
|---|---|
| / | Root of the entire filesystem |
| /home | User home directories (e.g., /home/alice) |
| /root | Home directory for the root (superuser) account |
| /etc | System-wide configuration files |
| /var | Variable data — logs, caches, spool files |
| /tmp | Temporary files (cleared on reboot) |
| /usr | User programs, libraries, documentation |
| /bin | Essential user command binaries (ls, cp, mv) |
| /sbin | Essential system binaries (fdisk, iptables) |
| /opt | Optional third-party software |
| /dev | Device files (disks, terminals, USB) |
| /proc | Virtual filesystem exposing kernel and process info |
| /sys | Virtual filesystem for kernel device/driver info |
| /mnt | Temporary mount points |
| /media | Mount points for removable media (USB, CD) |
| /boot | Boot loader files and the kernel image |
| /lib | Essential shared libraries for /bin and /sbin |
/
├── home/
│ ├── alice/
│ └── bob/
├── etc/
│ ├── ssh/
│ ├── nginx/
│ └── passwd
├── var/
│ ├── log/
│ └── www/
├── usr/
│ ├── bin/
│ ├── lib/
│ └── share/
└── tmp/
Start from the root (/) and specify the full location:
/home/alice/documents/report.txt
/etc/nginx/nginx.conf
/var/log/syslog
Start from your current directory:
documents/report.txt # relative to current directory
../bob/notes.txt # go up one level, then into bob/notes.txt
./script.sh # current directory
| Symbol | Meaning |
|---|---|
. | Current directory |
.. | Parent directory |
~ | Home directory of the current user |
~alice | Home directory of user alice |
- | Previous directory (used with cd) |
Shows your current location in the filesystem:
$ pwd
/home/alice
Move between directories:
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.