next up previous contents
Next: The /mnt and Up: Directory Tree Overview Previous: /homeSweet

Temporary Files, /tmp and /usr/tmp

META:
/tmp on root can be a bad idea

Many programs need to create temporary files. In order not to fill the users' directories (and disks, on systems where home directories are on different disks) with such, sometimes large and plentiful, files, the directories /tmp and /usr/tmp exist. Most programs automatically place temporary files in one of these. Conventions differ from system to system, but generally it is considered better for programs to use /usr/tmp , because then the root filesystem (where /tmp resides) need not be as large. In fact, some systems even make /tmp a symbolic link to /usr/tmp (although this only works after /usr has been mounted) to force temporary files out of the root filesystem (this greatly reduces the size requirements for the root filesystem). Some large systems mount an especially fast disk on /tmp (or /usr/tmp ); temporary files are usually used for a short time only, or as an extension to physical memory, so having /tmp be fast hopefully makes the system faster on the whole.

On many systems, /tmp is automatically cleaned (by an appropriate command in /etc/rc and/or cron(8) ), so that the temporary files won't remain and take up space when they are no longer needed. /usr/tmp is usually not cleaned automatically (

META:
why?).



Ross Biro
Mon May 22 09:14:56 PDT 1995