purge -- overwrite specified files


purge [ -f ] [ -r ] [ -v ] [ -m num ] [ -suo ] [ -t type ] ... [ -z ] [ files ] ...


The purge command is used to overwrite various parts of the system. It overwrites files specified on the command line, or those listed in a policy file maintained by the system administrator. The policy file defines types of files and devices which are purged as a group. The utility can be used to purge individual files, divvy(ADM) divisions, fdisk(ADM) partitions, or other devices like magnetic tapes and floppies. An option even exists to zero memory. After purge is run, no data remains on the specified device or file.

After being overwritten, od(C), dd(C), or hd(C) may be used to verify that no data remains on the device or in the file.

When files are overwritten multiple times, the first pass writes binary zeros. Subsequent passes alternate writing binary ones and binary zeros.

The optional flags are outlined below:

Do not warn about files which are not present or inaccessible. Attempts to purge a floppy which is inaccessible (for example, the door is open) will always generate a diagnostic on the system console.

Recursively purge directories. Without this flag no action is taken upon directories.

Verbose operation, list the name of each file as it is overwritten.

-m num
Overwrite each file num times.

Overwrite files and devices designated as ``system'' in the policy file. (Equivalent to -tsystem.)

Overwrite files and devices designated as ``user'' in the policy file. (Equivalent to -tuser.)

Overwrite other (non-system and non-user) files and filesystems. This purges all entries in the policy file which are not of either type system or user. This flag, by the nature of its implicit definition, has no -t equivalent.

-t type
Overwrite the files identified in the policy file as being part of group type.

Writes binary zeroes to system memory, including memory buffers of intelligent devices (that is, disk controller cache, etc.). This will close down the system immediately. This should only be done from single-user mode, or when no users are logged on. The system will autoboot if so configured (see boot(HW)). Only the super user may use this option.

Regular, directory or special files to purge.
Similarly to regular files, most special files can be purged by being placed in the policy file or with the command purge /dev/special_file. Block special files and some character special files can be overwritten. The console, ttys, printers and other ``infinite output'' devices cannot be purged with this command. Disks, floppies and magnetic tapes can be overwritten. Tape devices are first erased once and then overwritten the specified number of times.

When both types and files are specified on the command line, all of the indicated files are overwritten by the utility. In particular, first the files selected from the policy file, and then those specified on the command line, are overwritten.

Each line in the policy file (/etc/default/purge) designates a file, filesystem or device as a member of some type. The syntax of a line is:

file type [ count ]

The optional count field is the number of times to overwrite file. The default count is one. The utility will overwrite file any time the command

purge -t type

is given.

Blank lines in the policy file and lines beginning with ``#'' are ignored.


purge: warning: invalid entry in policy file (line n)
An invalid line was read from the policy file where n is the number of the incorrectly formatted line.

purge: filename is a directory
If the -r switch is not specified no action is taken upon directories and this diagnostic is displayed.

purge: only the superuser can zero memory
This message is displayed when a user other than the super user tries to use the -z option.


the policy file

See also

boot(HW), dd(C), hd(C), od(C), purge(F), rm(C)

Standards conformance

purge is not part of any currently supported standard; it is an extension of AT&T System V provided by The Santa Cruz Operation, Inc.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003