sum (Unix)

sum is a legacy utility available on some Unix and Unix-like operating systems.

This utility outputs a 16-bit checksum of each argument file, as well as the number of blocks they take on disk.

[2] The default algorithm on FreeBSD and GNU implementations is the BSD checksum.

The System V sum, -s in GNU sum and -o2 in FreeBSD cksum: The sum utility is invoked from the command line according to the following syntax: with the possible option parameters being: When no file parameter is given, or when FILE is -, the standard input is used as input file.

Example of use: Example of -s use in GNU sum: Example of using standard input, -r and printf to avoid newline: