sum(1) sum(1)
NAME
sum - print checksum and block count of a file
SYNOPSIS
sum[ -r][ --][ file]...
DESCRIPTION
sum calculates and prints a checksum for the named file or directory,
and also prints the space used by the file, in 512-byte blocks. The
output is written to standard output. sum counts the contents of all
bytes together for calculating the checksum.
sum may be useful for checking that a file has arrived complete and
unchanged after a file transfer.
OPTIONS
-r Uses an alternate algorithm to compute the checksum and prints a
different checksum. When the checksum is being calculated, the
sum is shifted 1 bit to the right before the next byte is added.
-- End of the list of options. Must be specified if file begins with
-.
file Name of the file whose checksum is to be calculated. Both ordi-
nary files and directories may be specified. You may name more
than one file.
file not specified:
sum reads from standard input.
Caution:
The algorithms used in computing the checksum may not be port-
able. Different checksums may thus be produced for the same file
when sum is run on different systems.
LOCALE
The LCMESSAGES environment variable governs the language in which
message texts are displayed. If LCMESSAGES is undefined or is defined
as the null string, it defaults to the value of LANG. If LANG is like-
wise undefined or null, the system acts as if it were not internation-
alized.
The LCALL environment variable governs the entire locale. LCALL
takes precedence over all the other environment variables which affect
internationalization.
Page 1 Reliant UNIX 5.44 Printed 11/98
sum(1) sum(1)
EXAMPLES
Example 1
Checksum of the file months using the first algorithm:
$ sum months
6658 1 months
Example 2
Checksum of the file months using the second algorithm:
$ sum -r months
62412 1 months
NOTES
The following error message is displayed if file is the mount point
for an NFS file system:
sum: Read error on file: is a directory
SEE ALSO
cksum(1), wc(1).
Page 2 Reliant UNIX 5.44 Printed 11/98