Jump to content

sum (Unix)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 83.233.148.237 (talk) at 23:38, 22 August 2012 (WP convention). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

The sum command is a utility on unix-like systems that computes the checksum of each argument file, as well as the number of blocks they take on disk.[1]

According to the manual page, sum uses two different algorithms for calculating the checksum and blocks, the SYSV checksum algorithm and the default BSD checksum algorithm. Switching between the two algorithms is done via command line options.

The algorithms implemented in this program are less sensitive than more modern checksum methods ‒ simple sums do not depend on the order of the data. The GNU manual page states: "sum is provided for compatibility; the cksum program is preferable in new applications."

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 manual page available with most *NIX distributions; invoked via man sum