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.

link|improve this question

feedback

2 Answers

up vote 13 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.

link|improve this answer
feedback

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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