The Linux Directory Structure
By Stephen Bucaro
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.|
|/bin||Command binaries (e.g., cat, ls, cp) that need to be available in single user mode; for all users.|
|/boot||Boot loader files such as GRUB, LILO, SYSLINUX or Loadlin.|
|/dev||Device files. Each device connected to a system are represented by a device file.|
|/etc||This directory holds everything that does not belong elsewhere (however, restricted to static configuration files and may not contain binaries).|
|/home||Users home directories, (except the root user's home directory) containing saved files, personal settings, etc.|
|/lib||Library files for the binaries stored in /bin and /sbin.|
|/lost+found||On 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.|
|/media||Mount points for plugnplay removable media such as USBs and CD ROMs.|
|/mnt||Mount point for manually mounted filesystems for the system administrator.|
|/opt||Optional software packages.|
|/proc||Virtual filesystem providing process and kernel information files.|
|/root||Home directory for the root user.|
|/run||Run-time variable data: Information about the running system since last boot, e.g., currently logged-in users and running daemons.|
|/sbin||Binary files associated with system administration and maintenance.|
|/srv||Data for services provided by this system, such as data and scripts for web servers and FTP servers.|
|/sys||Information about the devices connected to the computer.|
|/tmp||Temporary files, whether generated by the user or the system. Often not preserved between system reboots.|
|/usr||X Window System, the kernel source code with its header files, libraries for the binaries in /usr/bin/ and /usr/sbin/, include files.|
|/var||Files 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.
More Windows Administration Information:
• Understanding the Linux Boot Process
• The Fedora 3 Linux File Structure
• How to Use the VIM Text Editor in Linux
• Dual-Boot Windows and Ubuntu
• Fedora 3 Modem Installation
• Connecting Linux to the Internet
• Setting Up a Basic Ethernet LAN on a Linux PC
• What is Linux?
• Bootloaders In Linux
• Migrating to Linux: Installing Software