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/tmpwhen 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
Method 1: Delete Files Older Than 7 Days (Recommended)
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.
Related Guides
- Learn about cleaning [Windows Temp Folder].
- How to clean up Linux /var/log.
- Check if you can clean APT package cache.
Discussion
Loading authentication...