Linux
Linux File System Structure
A tour of the Linux directory tree and the roles of its main system directories.
4 views
The Linux file system structure follows a hierarchical, tree-like organization starting from the root directory, denoted as /. It adheres to the Filesystem Hierarchy Standard (FHS), which defines the purpose of key directories. Below is a concise description of the Linux file system structure and the roles of its primary directories:
- / (Root): The top-level directory, containing all other directories and files.
- /bin: Essential binary files (executables) for basic system commands, like
ls,cp, andcat, used by all users. - /boot: Contains boot loader files, such as the kernel image and initial RAM disk, needed to start the system.
- /dev: Device files representing hardware devices (e.g.,
/dev/sdafor a disk,/dev/nullfor a null device). - /etc: System-wide configuration files, such as
/etc/passwdfor user info and/etc/fstabfor file system mounts. - /home: User home directories (e.g.,
/home/username), where personal files and user-specific configurations are stored. - /lib and /lib64: Shared libraries required by binaries in
/binand/sbin, with/lib64for 64-bit libraries. - /media: Mount points for removable media, like USB drives or CDs, typically managed by the system.
- /mnt: Temporary mount points for manually mounted file systems, such as external drives.
- /opt: Optional software packages, often third-party or manually installed applications.
- /proc: Virtual file system providing process and system information (e.g.,
/proc/cpuinfofor CPU details). - /root: Home directory for the root (superuser) account, separate from
/home. - /run: Runtime data for processes, such as PID files or sockets, cleared on reboot.
- /sbin: System binaries for administrative tasks, like
fdiskorreboot, typically for root use. - /srv: Data for services hosted by the system, such as web or FTP server files.
- /sys: Virtual file system for system and hardware information, similar to
/procbut focused on kernel and devices. - /tmp: Temporary files, often cleared on reboot or by specific system policies.
- /usr: Secondary hierarchy for user-related data, including:
- /usr/bin: Non-essential user binaries (e.g.,
gcc,python). - /usr/lib: Libraries for
/usr/binprograms. - /usr/local: Locally installed software, not managed by the package manager.
- /usr/share: Architecture-independent data, like documentation or icons.
- /usr/src: Source code, often for the kernel or other software.
- /usr/bin: Non-essential user binaries (e.g.,
- /var: Variable data that changes during system operation, including:
- /var/log: Log files (e.g.,
/var/log/syslogor/var/log/messages). - /var/cache: Cached data for applications.
- /var/spool: Data awaiting processing, like print jobs or mail.
- /var/tmp: Temporary files preserved across reboots.
- /var/log: Log files (e.g.,