Linux (and Unix, and whatever the fuck else; I don't care) has a bad ass filesystem. Why? It was put together extremely intelligently. The directory structure follows (or at one time did follow) the Linux File System Standard (FSSTND). Because of the variations that exist from distribution to distribution, I have used the Red Hat version of the filesystem to document the directories here.

These directories make up the basis of a Linux filesystem:
The layout of directories in a Unix Filesystem is based loosely (or strictly, depends on the distro) on the Filesystem Hierarchy Standard (FHS) a standard initially drafted February 14, 1994 for the purposes of standardizing the directory tree of various Linux distros, but as of 1995, the scope of the FHS has been expanded to include commercial and BSD style Unicies.


Under the FHS standard, directories are layed out as given by the following table. Italics indicate optional directories and bold face indicates required sybolic links to the directory given.
  1. /
    1. bin/
    2. boot/
    3. dev/
    4. etc/
      1. X11/
      2. opt/
    5. home/
    6. lib/
      1. modules/
    7. mnt/
    8. opt/
    9. root/
    10. sbin/
    11. tmp/
    12. usr/
      1. X11R6/
      2. bin/
        1. X11/ -> /usr/X11R6/bin
        2. mh/
      3. games/
      4. include/
        1. X11/ -> /usr/X11R6/include/X11
        2. bsd/
        3. g++/
      5. lib/
        1. X11 -> /usr/X11R6/lib/X11
      6. local/
        1. bin/
        2. games/
        3. include/
        4. lib/
        5. sbin/
        6. share/
        7. src/
      7. sbin/
      8. share/
        1. dict/
        2. doc/
        3. games/
        4. info/
        5. locale/
        6. man/
          1. man1/
          2. man2/
          3. man3/
          4. man4/
          5. man5/
          6. man6/
          7. man7/
          8. man8/
        7. nls/
        8. misc/
        9. terminfo/
        10. tmac/
        11. zoneinfo/
      9. src/
      10. spool/ -> /var/spool/
        1. locks -> /var/lock/
      11. tmp/ -> /var/tmp/
    13. var/
      1. account/
      2. cache/
        1. fonts/
        2. man/
        3. www/
        4. <package>/
      3. crash/
      4. games/
      5. lib/
        1. misc/
        2. <editor>/
        3. xdm/
        4. <pkgtool>/
        5. <package>/
      6. lock/
      7. log/
      8. mail/
      9. opt/
      10. run/
      11. spool/
        1. lpd/
          1. <printer>/
        2. mqueue/
        3. news/
        4. rwho/
        5. uucp/
      12. tmp/
      13. yp/

Notes & Explanations - organized by list number

1. This is the directory under which all other directories are organized. Files should never be created here.

1.1. Contains essential user binaries. This directory should have no subdirectories.

1.2. Contains static files for the boot loader. The kernel is located either here or in /

1.3. Contains files that represent devices on the Unix system.

1.4. Host specific configuration. Should contain no binaries, only configuration files and some initialization scripts.

1.4.1. Configuration for the X11 window system.

1.4.2. Configuration for /opt

1.5. Suggested placement for user directories and files.

1.6. Essential shared libraries and kernel modules.

1.6.1. Contains aforementioned kernel modules.

1.7. Mount points for temporarily mounted filesystems.

1.8. Contains add-on application software packages.

1.9. Home directory for the root user.

1.10. System binaries - utilities for system administration and other root-only commands are stored here

1.11. Temporary files - these files may be deleted in a site specific manner, and are used for temporary storage.

1.12. Shareable, read only data.

1.12.1. X11 windows system binaries, libraries and includes.

1.12.2. The primary directory of commands on the system. Commands for the MH mail handling system.

1.12.3. Directory for standard includes for C/C++.

1.12.4. Libraries for programming and packages.

1.12.5. Local hierarchy for the system administrator when installing software locally. This differs from /usr in that files installed to here are not a part of the standard Unix distribution that installed all the system files.

1.12.7. Non-essential system administrator binaries.

1.12.8. Architecture independent data. Word lists. Miscellaneous documentation. GNU info's primary directory. Locale information. User programs manuals. System call manuals. Library call manuals. Special File manuals. File Format manuals. Games manuals. Miscellaneous manuals. System administration manuals. Native language support. Miscellaneous architecture independent data. Directories for terminfo database. troff macros not distributed with groff. Timezone info and configuration.

1.12.9. Non-local source code.

1.13. Variable data.

1.13.1 Process account logs (if supported)

1.13.2 Cached data ... ... for generated font data. ... for manual pages. ... for www pages. ... for <package>.

1.13.3. System crash dumps (if supported).

1.13.4. Variable game data.

1.13.5. Variable state information.

1.13.6. Lock files.

1.13.7. Log files and directories.

1.13.8. User mailbox files.

1.13.9. Variable data for /opt.

1.13.10. Data relevant to running processes.

1.13.11. Application spool data. Data for printers/printing processes. Mail queue data. News data. Remote who data. Unix to Unix copy data.

1.13.12. Temporary data preserved between system reboots.

1.13.13. Network Information Service (NIS) database files.

All data paraphrased from "Filesystem Hierarchy Standard - Version 2.1", published by the Filesystem Hierarchy group.

Log in or register to write something here or to contact authors.