The Filesystem Hierarchy Standard (FHS) is a set of guidelines that defines the structure and organization of directories in a Linux or Unix-like operating system. FHS aims to ensure consistency and compatibility across different Linux distributions, making it easier for software developers, system administrators, and users to understand and navigate the file system. Here’s an introduction to the standard directory structure in Linux based on FHS:
– The top-level directory and the starting point of the file system hierarchy.
– Contains essential system files, including the kernel, bootloader configuration, and core system utilities.
– Stores essential binary executables (commands) that are required for system recovery and repair.
– Common command-line utilities like `ls`, `cp`, and `mkdir` are found here.
– Contains files related to the system’s boot process, including the kernel image, initial ramdisk (initramfs), and boot loader configurations (e.g., GRUB).
– Houses device files that represent and allow interaction with hardware devices, including disk drives, partitions, and input/output devices.
– Device nodes are used to communicate with and control hardware components.
– Stores system-wide configuration files and scripts used by various applications and system components.
– Contains configuration files for networking, user accounts, and system services.
– Home directories for regular users are typically located here.
– Each user has a separate subdirectory with their username, where they can store their personal files and configurations.
– Contains shared libraries (dynamic link libraries) that are essential for the functioning of programs in /bin and /sbin.
– Subdirectories like `/lib64` may exist on 64-bit systems to house 64-bit libraries.
– Used as a mount point for removable storage devices such as USB drives and external hard disks.
– Mounting these devices under /media provides convenient access to their contents.
– Provides a location for temporary mount points used for mounting file systems.
– Users or administrators can manually mount additional storage devices or network shares here.
– Often used by software vendors to install optional or third-party software packages.
– The directory structure within /opt may vary depending on the software package.
– A virtual file system that provides information about running processes, system configuration, and kernel parameters.
– Used for interacting with and monitoring the system and its processes.
– Home directory for the root user, the system administrator.
– Contains configuration files and data specific to the root user.
– Similar to /bin but contains binary executables for system administration tasks that require root privileges.
– Commands like `mount`, `ifconfig`, and `fdisk` are stored here.
– Intended to store data files for services provided by the system.
– Each service may have its subdirectory under /srv.
– Used for temporary storage of files and directories by various applications and users.
– Files in /tmp are typically deleted on system reboot.
– Contains user binaries, libraries, documentation, and data files for non-essential applications and packages.
– Often one of the largest directories on the system.
– Stores variable data files, such as log files, spool files, and temporary data created by system services and applications.
– Contains subdirectories like /var/log and /var/run.
Understanding the FHS-compliant directory structure is essential for Linux administrators and users, as it helps maintain consistency and provides a common reference point for system-related tasks and navigation within the file system.