Top

A Linux User Reference

Search tips
  • search ignores words that are less than 4 characters in length
  • searches are case insensitve
  • if a search does not return anything try it in Boolean mode then Query expansion mode by checking the appropriate radio button e.g. searching for 'cron' in just the Administration category returns nothing - presumably because the 50% threshold is reached. Boolean mode ignores this threshold so a search for 'cron' returns several hits
  • in Boolean mode preceding a word with a '+' means the result must include that word, a '-' means it must not
  • in Boolean mode '+crontab -anacron' means match articles about crontab that DO NOT mention anacron
  • to match a phrase e.g. 'manage system' check the Boolean mode radio button and enclose the phrase in quotes "some phrase ..."
  • in Query expansion mode the search context is expanded beyond the keywords you entered - relevancy of hits may well be degraded

FILESYSTEMS

FHS

  • Filesystem Hierarchy Standard
    (FHS)

    A standard for the linux filesystem, a recommendation for what files should be placed where. Its purpose is to

    • enable software to predict the location of installed files and directories
    • enable users to predict the location of installed files and directories.

    Two data use categories are defined, each with two opposing sub-categories:

    Data sharing - networked environments
    Shareable

    Used by multiple systems on a network e.g. datafiles, programs, documents

    Non-Shareable

    Not shared, specific to local system e.g. configuration files

    Data modification - how data changes
    Variable

    Changed frequently e.g. logfiles

    Static

    Rarely changes e.g. binary files

    For linux filesystems this pretty much equates to:

    Data sharing
    Shareable
     /usr, /usr/local, /home, /var/mail
    
    
    Non-Shareable
     /etc, /boot, /var/log, /proc
    
    
    Data modification
    Variable
     /home, /var/mail, /var/log, /proc
    
    
    Static
     /usr, /usr/local, /etc, /boot
    
    
  • Root filesystem contents

    It's contents must be adequate to boot, restore, recover and or repair the system. To such an end it should contain

    • Utilities and files sufficient to boot the system
    • Utilities and files needed by sysadmin to repair/restore a damaged system
    • Non-shareable data
    • Software should not create files or directories

    The following directories or symbolic links to directories are required in '/'.

    Directory Description Importance
    bin Command binaries Essential
    boot Static files of the boot loader Non-essential
    dev Device files Essential
    etc Host-specific system configuration Essential
    lib Shared libraries and kernel modules Essential
    media Mount point for removable media Non-essential
    mnt Mount point for mounting a filesystem temporarily Essential
    opt Add-on application software packages Non-essential
    sbin System binaries Essential
    root Root home directory Essential
    srv Data for services provided by this system Non-essential
    tmp Temporary files Non-essential
    usr Secondary hierarchy Non-essential
    var Variable data Non-essential

    Location of binary files

    Vendor supplied essential:      /bin/sbin
    Vendor supplied non-essential:  /usr/bin/usr/sbin
    Locally supplied essential:     /usr/local/bin/usr/local/sbin
    
  • Filesystem contents
    /boot
    • Static files of the boot loader - everything required for the boot process (except configuration files not needed at boot time) and the map installer.
    • Stores data that is used before the kernel begins executing user-mode programs. This may include saved master boot sectors and sector map files.
    • The operating system kernel must be located in either / or /boot.
  • Filesystem contents
    /dev
    • Special or device files.
    • If there is the possibility that device files will need to be manually created then this directory must contain a command named MAKEDEV which can create the devices as needed.
  • Filesystem contents
    /etc
    • Host-specific system configuration files.
    • A configuration file is a local file used to control the operation of a program; it must be static and cannot be an executable binary.
    • No binaries may be located under /etc.
  • Filesystem contents
    /home

    User home directories (optional).

  • Filesystem contents
    /lib
    • Essential shared libraries and kernel modules - shared library images needed to boot the system and run the commands in the root filesystem (in /bin and /sbin).
    • At least one of each of the following filename patterns are required (they may be files, or symbolic links):

      File Description
      libc.so.* The dynamically-linked C library (optional)
      ld* The execution time linker/loader (optional)
  • Filesystem contents
    /media
    • Mount point for removable media. This directory contains subdirectories which are used as mount points for removable media such as floppy disks, cdroms and zip disks.
    • The following directories (or symbolic links to directories) must be in /media if the corresponding subsystem is installed.

      Directory Description
      floppy Floppy drive (optional)
      cdrom CD-ROM drive (optional)
      cdrecorder CD writer (optional)
      zip Zip drive (optional)
  • Filesystem contents
    /mnt
    • Mount point for a temporarily mounted filesystem. This directory is provided so that the system administrator may temporarily mount a filesystem as needed.
    • The content of this directory is a local issue and should not affect the manner in which any program is run.
  • Filesystem contents
    /opt

    Add-on application software packages - is reserved for the installation of add-on application software packages.

  • Filesystem contents
    /root

    Home directory for the root user (optional). The root account's home directory may be determined by developer or local preference but this is the recommended default location.

  • Filesystem contents
    /sbin
    • System binaries. Utilities used for system administration (and other root-only commands) are stored in /sbin, /usr/sbin and /usr/local/sbin.
    • It contains binaries essential for booting, restoring, recovering and or repairing the system (along with binaries in /bin).
    • Programs executed after /usr is known to be mounted (when there are no problems) are generally placed into /usr/sbin.
    • Locally-installed system administration programs should be placed into /usr/local/sbin.
    • The following commands or symbolic links to commands are required in /sbin.

      Command Description
      shutdown Command to bring the system down.
  • Filesystem contents
    /srv

    Site specific data for services provided by this system.

  • Filesystem contents
    /tmp
    • Temporary files which must be made available for programs that require temporary files.
    • Programs must not assume that any files or directories in /tmp are preserved between invocations of the program.
  • Filesystem contents
    /usr hierarchy
    • The second major section of the filesystem - shareable, read-only data (i.e. should be shareable between various FHS-compliant hosts but must not be written to).
    • Any information that is host-specific or varies with time is stored elsewhere.
    • Large software packages must not use a direct subdirectory under the /usr hierarchy.
    • The following directories (or symbolic links to directories) are required in /usr.

      Directory Description
      bin Most user commands
      include Header files included by C programs
      lib Libraries
      local Local hierarchy (empty after main installation)
      sbin Non-vital system binaries
      share Architecture-independent data
  • Filesystem contents
    /var hierarchy
    • Contains variable data files - including spool directories and files, administrative and logging data, and transient and temporary files.
    • Some portions of the hierarchy are not shareable between different systems e.g. /var/log, /var/lock and /var/run.
    • Other portions may be shared, notably /var/mail, /var/cache/man, /var/cache/fonts and /var/spool/news.
    • If not made as a separate partition, it is often preferable to move it out of the root partition and into the /usr partition. (This is sometimes done to reduce the size of the root partition or when space runs low in the root partition.) It must not be linked to /usr because this makes separation of /usr and /var more difficult and is likely to create a naming conflict. Instead, link /var to /usr/var.
    • Applications must generally not add directories to the top level of /var. Such directories should only be added if they have some system-wide implication and in consultation with the FHS mailing list.
    • The following directories (or symbolic links to directories) are required in /var.

      Directory Description
      cache Application cache data
      lib Variable state information
      local Variable data for /usr/local
      lock Lock files
      log Log files and directories
      opt Variable data for /opt
      run Data relevant to running processes
      spool Application spool data
      tmp Temporary files preserved between system reboots
    • Several directories are reserved in the sense that they must not be used arbitrarily by some new application, since they would conflict with historical and or local practice. They are:

        /var/backups
        /var/cron
        /var/msgs
        /var/preserve