
Tech • AI • Robotics • Game
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.
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:.
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.
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.
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.
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.
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.
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.
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.
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.
/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.
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.
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