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.

Layout

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.

1.12.2.2. 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.

1.12.8.1. Word lists.

1.12.8.2. Miscellaneous documentation.

1.12.8.4. GNU info's primary directory.

1.12.8.5. Locale information.

1.12.8.6.1. User programs manuals.

1.12.8.6.2. System call manuals.

1.12.8.6.3. Library call manuals.

1.12.8.6.4. Special File manuals.

1.12.8.6.5. File Format manuals.

1.12.8.6.6. Games manuals.

1.12.8.6.7. Miscellaneous manuals.

1.12.8.6.8. System administration manuals.

1.12.8.7. Native language support.

1.12.8.8. Miscellaneous architecture independent data.

1.12.8.9. Directories for terminfo database.

1.12.8.10. troff macros not distributed with groff.

1.12.8.11. 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 ...

1.13.2.1. ... for generated font data.

1.13.2.2. ... for manual pages.

1.13.2.3. ... for www pages.

1.13.2.4. ... 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.

1.13.11.1. Data for printers/printing processes.

1.13.11.2. Mail queue data.

1.13.11.3. News data.

1.13.11.4. Remote who data.

1.13.11.5. 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 registerto write something here or to contact authors.