sum(C)


sum -- calculate a checksum and count the blocks in a file

Syntax

sum [ -lr ] [ file ... ]

Description

sum calculates and prints a checksum for the named file, and also prints the number of 512-byte blocks in the file.

If no file is named, standard input is used.

Options are:


-l
Print a long (32-bit) checksum. (The default is to print a short (16-bit) checksum.)

-r
Use an alternate (older) algorithm to compute the checksum. This alternate algorithm is sensitive to the order of the bytes in the data; the standard algorithm is not.
sum is typically used to validate data after being transported across unreliable media. It is also useful when you want to reduce the contents of a file into a representative value.

Limitations

``Read error'' is indistinguishable from ``End-of-file'' on most devices, so you need to check the block count.

See also

wc(C)

Standards conformance

sum is conformant with:

AT&T SVID Issue 2;
X/Open CAE Specification, Commands and Utilities, Issue 4, 1992: note that this command is marked as to be withdrawn.

Notices

A version of sum that can handle files greater than 2GB is available in /u95/bin. See sum(1) for more information.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005