sum(1)

NAME
sum - checksum and count the blocks in a file

SYNOPSIS
sum [OPTION] [FILE]

DESCRIPTION
Print checksum and block counts for each FILE. With no FILE, read standard input.

-h  print a terse usage statement and exit.

-r  use BSD sum algorithm, use 1K blocks [default]

-s  use System V sum algorithm, use 512 bytes blocks.

ORIGIN
Much of the code is derived from /usr/src/cmd/sum.c, Unix 7th Edition, ported to modern systems by Gunnar Ritter as part of the Heirloom Toolchest in 2003. This version has been further modified in 2020 to use POSIX getopt for argument parsing and to more closely match the behavior of the sum utility as implemented in GNU coreutils, and for greater ease of maintenance.

NOTES
This utility is provided mainly for compatability reasons. The System V algorithm is unable to detect added or missing NUL bytes. while the BSD algorithm may produce different results in different implementations. For these reasons, cksum(1) is preferable to use in new scripts.

SEE ALSO
cksum(1), wc(1), md5sum(1)