bitscoper.dev

Linux System Directories Explained

The Linux filesystem follows a meticulously structured hierarchical architecture designed to optimize organization.

1. The Root Directory

The root directory (/) serves as the primary node from which all subordinate directories and files emanate.

2. System Directories

  • /bin – Nested immediately beneath /, this directory houses indispensable user-level binary executables required for fundamental system operations, including core utilities such as ls, and cp.
  • /sbin – Residing within /, this enclave is dedicated to administrative binary executables, typically reserved for superuser privileges, encompassing tools like fdisk, and fsck.
  • /boot – Positioned within /, this directory encapsulates essential bootstrapping components, including kernel images, initial RAM disk images (initrd or initramfs), and bootloader configurations (e.g., GRUB or LILO).
  • /dev – An integral directory under /, it contains device nodes that interface with hardware and pseudo-devices, including block devices (/dev/sda), character devices (/dev/tty), and special-purpose system interfaces.
  • /etc – Situated under /, it serves as the nexus for system-wide configuration files, governing authentication, networking, service management, and daemon configurations.
  • /home – A subdirectory within /, it functions as the repository for individual user environments, encompassing personal data, user-specific configurations, and isolated workspaces.
  • /lib & /lib64 – Encapsulated within /, these directories store dynamically linked libraries and kernel modules required for the execution of both user and system-level binaries.
  • /media – Nested within /, this directory serves as an ephemeral mount point for removable media such as USB drives and optical discs, automatically detected and mounted by the system.
  • /mnt – Situated under /, this directory provides a transient mount point for manually mounted filesystems and network shares.
  • /opt – A compartmentalized directory beneath /, allocated for supplementary, proprietary, or third-party software installations that do not conform to the native package management structure.
  • /proc – A pseudo-filesystem within /, dynamically populated at runtime to expose kernel and process information, offering real-time introspection into system operations.
  • /root – Nested directly under /, this directory constitutes the personal workspace of the root user, distinct from regular user directories housed within /home.
  • /run – Located within /, this volatile directory retains runtime data, including process identifiers (PIDs), sockets, and other ephemeral interprocess communication artifacts.
  • /srv – Embedded within /, this directory is conventionally designated for server-specific data such as web service roots (/srv/www) or FTP repositories.
  • /sys – A virtualized pseudo-filesystem under /, designed to expose kernel device parameters, power states, and system control interfaces, often interfaced via sysfs.
  • /tmp – Temporarily housed within /, this directory provides ephemeral storage for transient files, automatically purged upon reboot to maintain a clean state.
  • /usr – Subsumed under /, this directory serves as a repository for user-level applications, including system utilities (/usr/bin), libraries (/usr/lib), and documentation (/usr/share/man).
  • /var – Situated beneath /, this directory accommodates dynamic, mutable data such as logs (/var/log), spool files (/var/spool), and temporary caches (/var/cache).

Documentation

Leave a Reply