Jump to content

Sum (Unix)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Spazure (talk | contribs) at 07:44, 16 July 2007 (Nominated for deletion: see Wikipedia:Articles for deletion/Sum(Unix)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Sum is a core GNU utility distributed with the UNIX- and Linux-based operating systems. This utility outputs the checksum of each argument file, as well as the number of blocks they take on disk.[1]

According to the manual, sum uses two different algorithms for calculating the checksum and blocks, the System V algorithm and the BSD (default) algorithm. Switching between the two algorithms is done via inline option parameters.

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

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

with the possible option parameters being:

  • -r
    • use BSD sum algorithm, use 1K blocks (defeats -s)
  • -s, --sysv
    • use System V sum algorithm, use 512 bytes blocks
  • --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.

References

  1. ^ Sum manual page available with most *NIX distributions; invoked via man sum


See also