whatis var-directory
/var
Also known as: var directory, /var/log
The directory for variable data that changes while the system runs: logs, caches, spools, databases, and package state.
What Is the /var Directory in Linux?
/var/log holds log files, /var/cache holds regenerable caches, /var/lib holds persistent application state (databases, Docker images, package manager records), and /var/spool holds queued mail and print jobs.
A full /var is a common cause of broken services, since daemons cannot write logs or state. du -sh /var/* quickly shows what is taking the space.
Example
sudo du -sh /var/* | sort -h Learn more about /var
- The /var Directory Explained /var holds the data that changes constantly while Linux runs: logs, caches, spools, and databases. This guide explains what lives in /var, why it grows over time, and how to manage its disk usage.
- journalctl and /var/log Explained Linux logs live in two places on most modern systems: the systemd journal, queried with journalctl, and traditional plain-text files under /var/log. This guide covers reading, filtering, and following logs in both.
- logrotate Explained: Keeping Log Files From Eating Your Disk logrotate renames, compresses, and eventually deletes aging log files on a schedule, and nearly every distro ships it preconfigured. Here is how the rotation cycle works and how to write configs for your own apps.