Tech • AI • Robotics • Game

ENFR

Linux Directory Structure Explained for Beginners🐧

3/10
AIKodeKloudNovember 4, 2026 at 08:15 PM3:01
Audio player

TL;DR

Linux organizes files under a single root directory, with standard top-level folders separating user data, software, configuration, changing system data, devices, and boot files.

KEY POINTS

One tree, no drive letters

Linux starts from /, the root directory, and everything attaches to that single hierarchy. Unlike Windows, separate disks and removable media are mounted into directories instead of being assigned drive letters such as C:.

User files live under /home

Personal files for regular accounts are typically stored in /home. A user such as Alex might have documents and downloads in a path like /home/alex. The administrator account, root, is different and usually has its own home directory at /root.

Programs are mainly under /usr

Most installed software is found under /usr, which roughly resembles Program Files in purpose. It contains application binaries, supporting libraries, and related resources needed by programs to run.

Core commands and libraries

The directories /bin, /sbin, and /lib traditionally store essential command-line tools, system administration commands, and shared libraries. Commands such as ls, cp, and cat are classic examples associated with /bin. On many modern distributions, these locations are often symbolic links into directories under /usr.

Extra software in /opt

The /opt directory is commonly used for additional software installed separately from the main package set. It is often chosen for third-party applications that keep their files grouped together in one place.

Settings are kept in /etc

System-wide configuration is generally stored in /etc. This includes items such as network settings and service configuration. Its role is somewhat similar to the Windows registry, but Linux usually relies on separate text files instead of one central database.

Changing data belongs in /var

The /var directory holds data that changes while the system runs, including logs, caches, and application state. On long-running servers, /var/log is a key place to inspect when disk space suddenly becomes tight.

Temporary and runtime files

Short-lived temporary files are placed in /tmp, where installers and applications may unpack data. Systems often clear it during reboot or cleanup. /run serves a different purpose by storing live runtime data such as process ID files and sockets, and its contents normally vanish after reboot.

Devices appear in /dev and are mounted elsewhere

Hardware devices are exposed as special files in /dev. A USB drive might appear as /dev/sdb, although names can vary. To access its contents, the filesystem is mounted into a directory, often under /media or /run/media, while /mnt remains a traditional location for manual mounts.

Virtual kernel views in /proc and /sys

/proc and /sys look like ordinary directories but are virtual filesystems. /proc exposes process information, including directories named by process ID, while /sys provides a view into devices and hardware state, including details such as battery information on some systems.

Boot, served data, and recovery

Files required to start the system, including the kernel, are kept in /boot. The directory /srv is intended for data served by the machine, such as website content. Some filesystems also include /lost+found, which stores items recovered during filesystem repairs.

CONCLUSION

The standard Linux directory layout follows a clear pattern: /home for personal files, /usr for software, /etc for configuration, /var for changing data, and /dev for devices. Once that structure is understood, navigating the system becomes far more predictable.

Ask a question

More from AI