The Linux Directory Structure

If you're familiar with the Windows operating system, then you understand what a hierarchical directory structure is. A hierarchical structure means that directories are organized in an inverted tree pattern. The top directory in the structure is called the root directory. The root directory contains subdirectories, A subdirectory may contain more subdirectories and files.

The main difference between the Windows operating system and Linux is that Linux does not use drive letters. Drive letters split a directory structure into different trees for each drive, Linux always has a single tree. Different storage devices may contain branches of the tree, but there is always a single tree under the root.

/The top of the directory structure. All files and directories appear under the root directory, even if they're stored on different physical or virtual devices.
/binCommand binaries (e.g., cat, ls, cp) that need to be available in single user mode; for all users.
/bootBoot loader files such as GRUB, LILO, SYSLINUX or Loadlin.
/devDevice files. Each device connected to a system are represented by a device file.
/etcThis directory holds everything that does not belong elsewhere (however, restricted to static configuration files and may not contain binaries).
/homeUsers home directories, (except the root user's home directory) containing saved files, personal settings, etc.
/libLibrary files for the binaries stored in /bin and /sbin.
/lost+foundOn the next boot after a system crash fsck will perform a filesystem check. Any corrupt files that it finds will be placed in this directory.
/mediaMount points for plugnplay removable media such as USBs and CD ROMs.
/mntMount point for manually mounted filesystems for the system administrator.
/optOptional software packages.
/procVirtual filesystem providing process and kernel information files.
/rootHome directory for the root user.
/runRun-time variable data: Information about the running system since last boot, e.g., currently logged-in users and running daemons.
/sbinBinary files associated with system administration and maintenance.
/srvData for services provided by this system, such as data and scripts for web servers and FTP servers.
/sysInformation about the devices connected to the computer.
/tmpTemporary files, whether generated by the user or the system. Often not preserved between system reboots.
/usrX Window System, the kernel source code with its header files, libraries for the binaries in /usr/bin/ and /usr/sbin/, include files.
/varFiles whose content is expected to continually change during normal operation of the system such as logs and spool files.

The Filesystem Hierarchy Standard (FHS) defines the directory structure and directory contents in Linux operating systems. It is maintained by the Linux Foundation. Because all Linux distribution providers do no follow the FHS exactly, and because even with FHS compliant systems, not everyone agrees what should be contained in a specific folder, your system may contain other directories not listed here.

Learn more at

More Windows Administration Information:
• Linux Security Basics: How to Encrypt and Sign Files with GnuPG
• What is a Linux Distribution
• What is Linux?
• How to Protect Files and Directories in Linux
• Linux su vs sudo: What's the Difference?
• Linux Server Hardening
• What You Need to Know to Set Up a Simple Firewall in Linux
• Linux Server Step-by-Step Configuration Guide
• How to Detect and Guard against Linux Security Vulnerabilities
• CFS: Completely Fair Process Scheduling in Linux