What Is the Linux File System?
Linux organizes files and directories into a single hierarchical tree. Unlike Windows, where drives commonly appear as C:, D:, and so on, Linux starts from one top-level directory called the root directory, written as /.
Everything in the Linux filesystem is located somewhere under /. Hardware devices, configuration files, applications, logs, user home directories and temporary files all have conventional locations.
1. / — The Root Directory
The root directory is the top of the Linux filesystem hierarchy. It contains the major system directories needed to boot and operate the operating system.
You will commonly see directories such as /bin, /boot, /dev, /etc, /home, /lib, /root, /run, /tmp, /usr and /var.
2. /bin — Essential User Commands
/bin traditionally contains essential executable programs required for basic system operation and recovery. Commands such as ls, cp, mv, rm and similar utilities may be provided here.
On many modern Linux distributions, /bin is a symbolic link to /usr/bin because of the usr merge.
3. /boot — Boot Files
/boot contains files required during the boot process, including the Linux kernel and bootloader-related files.
Kernel
The core Linux operating system kernel is commonly stored under this directory.
Bootloader
Bootloader configuration and supporting files can be stored here.
Be careful when modifying files in /boot; incorrect changes can prevent a machine from booting.
4. /dev — Device Files
Linux represents many hardware and virtual devices as files under /dev. Disks, terminals, pseudo-devices and other device interfaces can appear here.
$ ls /dev/sd*
$ ls /dev/null
This is part of the Unix/Linux philosophy of exposing system resources through file-like interfaces.
5. /etc — System Configuration
/etc is one of the most important directories for administrators and DevOps engineers. It contains system-wide configuration files.
/etc/hosts
Local hostname-to-IP mappings.
/etc/fstab
Defines filesystems and mount configuration.
/etc/ssh
SSH server and client configuration.
/etc/nginx
Common location for Nginx configuration on many distributions.
When troubleshooting Linux servers, /etc is often the first place to investigate configuration.
6. /home — User Home Directories
/home contains the personal directories of normal users. For example, a user named john might have a home directory at /home/john.
$ ls
john developer tester
User-specific files, SSH configuration, shell history and application configuration may live inside each user's home directory.
7. /lib and /lib64 — Essential Libraries
These directories contain essential shared libraries and kernel modules needed by programs and the operating system.
As with /bin, modern distributions may merge or redirect traditional library paths into /usr/lib and related locations.
8. /root — Root User's Home
/root is the home directory of the root user. It is different from /: the first is the root user's home, while the second is the root of the entire filesystem.
9. /run — Runtime Data
/run contains runtime information created after the system boots. It commonly includes process IDs, sockets and other temporary runtime state.
Many files here are stored in memory-backed filesystems and do not persist across reboots.
10. /srv — Service Data
/srv is intended for site-specific or service-specific data. A web server or FTP service can use a directory below /srv for data it serves.
Actual usage varies by distribution and application architecture, but the directory provides a conventional place for service data.
11. /tmp — Temporary Files
/tmp is used for temporary files created by applications and users. Files here should generally be considered disposable.
$ cat /tmp/example.txt
Do not use /tmp as permanent storage for important application data.
12. /usr — User Programs and Resources
/usr contains a large portion of user-space programs, libraries, documentation and other read-only resources on a modern Linux system.
| Directory | Typical purpose |
|---|---|
| /usr/bin | Most user command-line programs |
| /usr/sbin | System administration programs |
| /usr/lib | Libraries and supporting files |
| /usr/share | Architecture-independent data such as documentation |
| /usr/local | Locally installed software and files |
13. /var — Variable Data
/var stores data expected to change during normal system operation. This includes logs, caches, databases, queues and application state.
/var/log
System and application logs.
/var/lib
Persistent application or service state.
/var/cache
Cached application data.
/var/tmp
Temporary files intended to persist longer than typical /tmp files.
$ sudo journalctl -xe
For DevOps troubleshooting, /var/log is especially important because service and system logs often reveal the reason for failures.
14. /mnt and /media — Mounted Filesystems
/mnt is traditionally used as a temporary mount point for filesystems mounted manually by an administrator. /media is commonly used for automatically mounted removable media.
/mnt
Temporary or administrator-managed mounts such as disks and filesystems.
/media
Common location for removable media such as USB drives and optical media.
15. Special Virtual Filesystems
Some Linux directories are not ordinary storage on disk. They expose kernel, process and hardware information through virtual filesystems.
| Path | Purpose |
|---|---|
| /proc | Process and kernel information |
| /sys | Kernel and device information |
| /dev | Device interfaces |
| /run | Runtime state |
$ cat /proc/meminfo
$ ls /sys/class
16. Commands Every Beginner Should Know
$ ls -lah # list files with details
$ cd /etc # change directory
$ find /var -type f # find files
$ du -sh /var/* # check directory sizes
$ df -h # check filesystem disk usage
$ mount # show mounted filesystems
These commands are particularly useful when investigating disk usage, configuration, permissions, mounted storage and application failures.
17. Linux Filesystem and DevOps
Understanding the filesystem is essential for DevOps work. Docker containers, web servers, databases, CI/CD agents and Linux services all interact with these paths.
Logs
Investigate /var/log when services fail or unexpected behavior occurs.
Configuration
Check /etc for service configuration and system settings.
Applications
Programs and libraries commonly live under /usr and /usr/local.
Storage
Understand mounts such as /mnt and persistent application data under /var/lib.
🧠 Remember These Paths
- / — filesystem root
- /bin — essential commands
- /boot — bootloader and kernel files
- /dev — device files
- /etc — configuration
- /home — normal users' home directories
- /root — root user's home
- /run — runtime state
- /tmp — temporary files
- /usr — programs and shared resources
- /var — changing data such as logs and application state
- /mnt / /media — mounted filesystems and removable media
Conclusion
The Linux filesystem may look complicated at first, but its structure becomes predictable once you understand the purpose of the major directories.
As a beginner, focus first on /, /etc, /home, /var, /usr, /tmp, /dev and /boot. These paths will appear constantly while managing Linux servers and DevOps infrastructure.
Once this mental model is comfortable, topics such as permissions, processes, systemd, Docker volumes, mounts, Kubernetes storage and Linux troubleshooting become much easier to understand.