Safe to Delete

Linux /var/tmp Folder (vs /tmp)

Quick Answer: /var/tmp stores temporary files that persist across system reboots. Deleting old unused files in /var/tmp is safe and reclaims drive space.

Bottom Line: It is safe to delete old, unreferenced files in /var/tmp. Unlike /tmp (which clears automatically on reboot), /var/tmp retains temporary files across system restarts, allowing abandoned temp files to hoard space.


What is the /var/tmp Directory?

Located at /var/tmp on Linux and Unix systems, this is a standard system directory for temporary files created by applications and system utilities.

/var/tmp vs /tmp Differences

  • /tmp: Usually mounted in RAM (tmpfs) or cleared automatically every time Linux reboots.
  • /var/tmp: Stored directly on your hard drive/SSD and persists across system reboots. Applications use /var/tmp when they need to store large temporary files (like video renders, archive extractions, or database updates) that must survive a system restart.

If applications crash before cleaning up after themselves, abandoned temp files stay in /var/tmp indefinitely, taking up 5 GB to 30 GB+.


Can You Delete Files in /var/tmp?

✅ Yes, it is safe to delete old, abandoned files.

  • Safety rule: Only delete files that are not currently locked or actively modified by running processes.
  • Frees disk space: Reclaims lost space on Linux root partitions.

How to Safely Clean Up /var/tmp

To avoid breaking currently active applications, delete only files in /var/tmp that haven’t been accessed in the last 7 days:

sudo find /var/tmp -type f -atime +7 -delete

Method 2: Automatic Cleanup via tmpfiles.d

Modern Linux distributions include systemd-tmpfiles to manage /var/tmp automatically.

Check /usr/lib/tmpfiles.d/tmp.conf. By default, Linux cleans files in /var/tmp after 30 days of inactivity.


Discussion

Loading authentication...

Related in linux

Linux Audit Framework Log Directory (/var/log/audit)

The Linux auditd service records security events, file access traces, and user commands in /var/log/audit. Learn how to clean auditd log files safely.

Safe to Delete

Fail2ban Ban History Database (/var/lib/fail2ban/fail2ban.sqlite3)

Fail2ban intrusion prevention daemon logs banned IP addresses and SSH brute-force attempts in fail2ban.sqlite3. Clearing Fail2ban database is safe.

Safe to Delete

GNOME Desktop File Indexer Database (~/.local/share/tracker/data)

GNOME Tracker caches desktop search index databases. Resetting the tracker database is safe.

Safe to Delete
Back to all files