/var directory
  • variable files
  • contains files to which the system writes data during the course of its operation
  • files whose content is expected to continually change during normal operation of the system—such as logs, spool files, and temporary e-mail files
  • is specific for each system, i.e., not shared over the network with other computers

Subdirectories

directory

description

/var/cache

  • contains cached data from application programs
  • such data are locally generated as a result of time-consuming I/O or calculation
  • the application must be able to regenerate or restore the data
  • the cached files can be deleted without loss of data

/var/cache/man

  • A cache for man pages that are formatted on demand. The source for manual pages is usually stored in /usr/share/man/man?/ (where ? is the manual section. See the manual page for man in section 7); some manual pages might come with a pre-formatted version, which might be stored in /usr/share/man/cat* . Other manual pages need to be formatted when they are first viewed; the formatted version is then stored in /var/cache/man so that the next person to view the same page won’t have to wait for it to be formatted

/var/lib

  • contains dynamic data libraries and files
  • state information
  • contains files that change while the system is running normally
  • persistent data modified by programs as they run, e.g., databases, packaging system metadata, etc.

/var/games

  • contains any variable data belonging to games in usr should be placed here
  • this is in case /usr is mounted read only

/var/log

  • contains various log files from various programs:
    • login (/var/log/wtmp, which logs all logins and logouts into the system)
    • syslog (/var/log/messages, where all kernel and system program message are usually stored)
  • files in /var/log can often grow indefinitely, and may require cleaning at regular intervals

/var/mail

  • mailbox files
  • this is the FHS approved location for user mailbox files
  • depending on how far your distribution has gone towards FHS compliance, these files may still be held in /var/spool/mail

/var/opt

  • variable data from add-on packages that are stored in /opt

/var/run

  • run-time variable data
  • contains system information data describing the system since it was booted
  • contains PIDs and other system information that is valid until the system is rebooted
  • files that contain information about the system that is valid until the system is next booted. For example, /var/run/utmp contains information about people currently logged in
  • in FHS 3.0, /var/run is replaced by /run; a system should either continue to provide a /var/run directory, or provide a symbolic link from /var/run to /run, for backwards compatibility

/var/spool

  • contains mail, news, and printer queues
  • spool for tasks waiting to be processed, e.g., print queues and outgoing mail queue
  • directories for news, printer queues, and other queued work. Each different spool has its own subdirectory below /var/spool, e.g., the news spool is in /var/spool/news . Note that some installations which are not fully compliant with the latest version of the FHS may have user mailboxes under /var/spool/mail

/var/spool/mail

  • deprecated location for users’ mailboxes, replaced by /var/mail

/var/tmp

  • temporary files to be preserved between reboots

/var/local

  • variable data for programs that are installed in /usr/local (i.e., programs that have been installed by the system administrator)
  • Note that even locally installed programs should use the other /var directories if they are appropriate, e.g., /var/lock

/var/lock

  • lock files
  • files keeping track of resources currently in use
  • contains lock files created by programs to indicate that they are using a particular file or device
  • many programs follow a convention to create a lock file in /var/lock to indicate that they are using a particular device or file. Other programs will notice the lock file and won’t attempt to use the device or file