Commands may create temporary files that also take up disk space.

The actual files that you’re creating aren’t the only users of disk space. When you run a command, the command often creates temporary files . Usually, these files are hidden from you and should stay that way. But you should know about temporary files so you have a better idea of the impact of your actions on the system.

For example, right now I’m editing this chapter using vi. When I’m editing a file, vi creates temporary buffers in another directory. On our system, these buffers are kept in /tmp. So right now, when I look in /tmp, I see two files belonging to me:

% ls -l /tmp | egrep lmui
  ...
-rw------1 lmui 13312 Sep 26 11:19 Ex23008
-rw------1 lmui 10240 Sep 26 11:17 Rx23008
  ...

Obviously, the bigger the file you’re editing, the bigger the temporary file. When you exit vi, these files are removed.

Other programs also create temporary files. For example, mailer programs often make a copy of your mail file, either in your home directory or in a systemwide temporary directory. FrameMaker creates several temporary files, mostly backup files and a lock file, all in the current directory. The Emacs editor creates backup files with trailing tildes (~). When using a network retrieval program like Mosaic, files are copied into/tmp.

Get WYNTK: UNIX System Admininistrator now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.