What Is /var/tmp

Content on WhatAnswers is provided "as is" for informational purposes. While we strive for accuracy, we make no guarantees. Content is AI-assisted and should not be used as professional advice.

Last updated: April 11, 2026

Quick Answer: /var/tmp is a system temporary directory in Unix and Linux operating systems where applications store temporary files designed to persist across system reboots. Unlike /tmp which is often cleared at boot, files in /var/tmp typically remain for 30+ days, making it essential for large installers, package managers, and database operations.

Key Facts

Overview

/var/tmp is a system directory found on Unix and Linux operating systems that serves as a designated location for temporary files created by applications and system processes. Unlike the commonly used /tmp directory, files stored in /var/tmp are designed to persist across system reboots and are subject to longer retention periods.

The directory is part of the Filesystem Hierarchy Standard (FHS), which defines the structure and organization of directories in Unix-like systems. Located under the /var partition, /var/tmp provides a stable intermediate storage solution for applications that need to maintain temporary data across system restarts or extended operation periods. This distinction makes it crucial for large installation processes, database operations, and other applications that cannot afford to lose temporary working files during a system reboot.

How It Works

/var/tmp operates as a standard Unix filesystem directory with specific characteristics and permissions that distinguish it from other temporary storage locations:

Key Comparisons

Feature/var/tmp/tmp/dev/shm
PersistenceSurvives rebootsOften cleared at bootCleared on reboot
Retention Period30+ days (configurable)1-7 days typicallyNo persistent cleanup
Storage LocationDisk-based (/var partition)Disk or RAM-basedRAM-based (in-memory)
Common Use CasesInstallers, package managers, databasesShort-lived application filesHigh-speed temporary data
PerformanceStandard disk speedVariable (depends on mount)Very fast (memory access)

Why It Matters

Understanding the distinction between /var/tmp and other temporary directories helps developers and administrators choose the appropriate location for temporary files based on persistence requirements, retention expectations, and performance needs. Proper utilization of /var/tmp ensures that critical temporary operations can complete reliably across system restarts and extended operational periods.

Sources

  1. Linux Foundation - Filesystem Hierarchy StandardCC-BY-SA-2.5
  2. Linux Manual Pages - File System HierarchyGPL-2.0
  3. GNU Coreutils ManualGFDL-1.3

Missing an answer?

Suggest a question and we'll generate an answer for it.