What is the Linux file system hierarchy and what are the main directories?

Beginner

Answer

The Linux file system follows the Filesystem Hierarchy Standard (FHS). Key directories include:

  • / - Root directory, the top-level directory
  • /bin - Essential user binaries (commands)
  • /boot - Boot loader files and kernel
  • /dev - Device files
  • /etc - System configuration files
  • /home - User home directories
  • /lib - Essential shared libraries
  • /media - Mount points for removable media
  • /mnt - Temporary mount points
  • /opt - Optional software packages
  • /proc - Virtual filesystem with process information
  • /root - Root user's home directory
  • /run - Runtime data
  • /sbin - System administration binaries
  • /tmp - Temporary files
  • /usr - User programs and data
  • /var - Variable data (logs, databases, etc.)