sum [–ciprtT] [file…]
The sum utility is fully supported for compatibility with older UNIX systems. However, it is recommended that the cksum utility be used instead because it may provide greater functionality and is considered the standard for portable UNIX applications as defined by POSIX.2 IEEE standard 1003.2-1992.
sum calculates and displays a checksum for each input file. A checksum is an error-checking technique used by many programs as a quick way to compare files that have been moved from one location to another to ensure that no data has been lost. It also displays the number of 512-byte blocks in each file.
If you do not specify any files, or if you specify – as the file name, sum reads standard input (stdin).
checksum blockcount filename
checksum blockcount filename
If a file operand is not specified, the path name and its leading white space is omitted.
All other error messages are sent to standard error.
sum can calculate checksums in a variety of ways. The default checksum algorithm produces a 16-bit unsigned integer resulting from the arithmetic addition of each input byte. This checksum algorithm is not sensitive to byte order.
For more information about the effect of _UNIX03 on the sum command, see Shell commands changed for UNIX03.
See Localization for more information.
The default checksum algorithm is compatible with UNIX System V.2 and later. The –r algorithm is also available on UNIX System V.2 and is the default algorithm for Berkeley and Version 7. The –c, –i, and –t options are not available under UNIX.
cmp, cksum, diff, ls, wc