Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I haven't put much thought into this until now, but it seems odd that there is a /var/tmp and /tmp directories for most of the linux distro's I routinely use ( Ubuntu, Centos, Redhat ).

Is there any semantic difference between the two, like when whoever designed the first file system layout, he or she thought "Not all tmp file's are created equal!"

The only difference I've found for centos, is that /tmp routinely scrubs out files older then 240 hours while /var/tmp holds onto stale files for 720 hours.

share|improve this question
1  
Here is a similar question on Unix & Linux: What is the difference between /tmp and /var/tmp? –  pabouk Nov 11 '13 at 7:13

2 Answers 2

up vote 18 down vote accepted

The main difference between both, is that /tmp is wiped whenever the system reboots where as /var/tmp gets preserved across reboots.

You'll be able to find further information regarding linux standard directory structures at the following link : http://www.pathname.com/fhs/pub/fhs-2.3.html#VARTMPTEMPORARYFILESPRESERVEDBETWEE.

share|improve this answer

Historically, /tmp was an in-memory-only filesystem, meaning its contents were destroyed by a reboot. /var/tmp was in a real file system, meaning its contents could survive a reboot.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.