The /var filesystem

The /var filesystem contains data such as printer spools and logfiles that vary over time. Since variable data is always changing and growing, /var is usually contained in a separate partition to prevent the root partition from filling. The following subdirectories can be found under /var:


Some systems maintain process accounting data in this directory.


/var/cache is intended for use by programs for the temporary storage of intermediate data, such as the results of lengthy computations. Programs using this directory must be capable of regenerating the cached information at any time, which allows the system administrator to delete files as needed. Because it holds transient data, /var/cache never has to be backed up.


This optional directory holds crash dumps for systems that support that feature.


This optional directory is used to store state information, user score data, and other transient items.


Lock files, used by applications to signal their existence to other processes, are stored here. Lock files usually contain no data.


The /var/log directory is the main repository for system logfiles, such as those created by the syslog system. For example, the default system logfile is /var/log/messages.


This is the system mailbox, with mail files for each user. /var/mail is a replacement for /var/spool/mail and aligns FHS with many other Unix implementations. You may find that your Linux distribution still ...

Get LPI Linux Certification in a Nutshell, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.