sum (Unix)

sum is a legacy utility available on some Unix and Unix-like operating systems. This utility outputs the checksum of each argument file, as well as the number of blocks they take on disk.[1]

sum
Original author(s)Ken Thompson
Developer(s)AT&T Bell Laboratories
Initial releaseNovember 3, 1971 (1971-11-03)
Operating systemUnix, Unix-like, Inferno
TypeCommand
Licensecoreutils: GPLv3+

Overview

The sum program is generally only useful for historical interest. It is not part of POSIX. Two algorithms are typically available: a 16-bit BSD checksum and a 32-bit SYSV checksum. Both are weaker than the (already weak) CRC32 used by cksum.[2]

The default algorithm on FreeBSD and GNU implementations is the weaker BSD checksum. Switching between the two algorithms is done via command line options.[2][1]

Syntax

The sum utility is invoked from the command line according to the following syntax:

sum [OPTION]... [FILE]...

with the possible option parameters being:

  • -r
  • -s, --sysv
  • --help
    • display the help screen and exit
  • --version
    • output version information and exit

When no file parameter is given, or when FILE is -, the standard input is used as input file.

See also

References

  1. sum(1) — manual pages from GNU coreutils
  2. sum(1)  FreeBSD General Commands Manual
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.