How to Remove Temporary Files on UNIX or XENIX System

ID: Q118914

The information in this article applies to:

SUMMARY

In the past, most UNIX systems would remove all files in /tmp and /usr/tmp by default when the system went multiuser by executing a file called /etc/rc.

Since this removal of temporary files no longer seems to occur, it appears that SCO has removed deleting temporary files from the default behavior of the /etc/rc.d family of scripts. You can remove these files by using the "rm" command.

MORE INFORMATION

Many of the temporary files created by FoxPro for UNIX in /tmp are zero- length files.

To set up your UNIX or XENIX system to automatically clean out temporary files, use a UNIX or XENIX editor (for example, vi) and add the following line to etc/rc.d/4/cleanup:

  rm -f /tmp/*  /usr/tmp/*

This command will remove temporary files from both the /tmp and /usr/tmp directories. The "-f" option tells "rm" not to prompt the user for confirmation when deleting files for which the user does not have write permission. To recursively delete the specified directories, add the "-r" option to the "rm" command.

REFERENCES

SCO UNIX/XENIX Operating System "User's Reference"

Additional reference words: FoxUnix 2.60 temp erase expunge KBCategory: kbprg KBSubcategory:

Last Reviewed: August 28, 1995