Wikipedia

Sum (Unix)

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

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]

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
    • use BSD checksum algorithm, use 1K blocks (defeats -s)
  • -s, --sysv
    • use SYSV checksum 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.

See also

References

  1. ^ a b sum(1) — manual pages from GNU coreutils
  2. ^ a b sum(1) – FreeBSD General Commands Manual

External links

This article is copied from an article on Wikipedia® - the free encyclopedia created and edited by its online user community. The text was not checked or edited by anyone on our staff. Although the vast majority of Wikipedia® encyclopedia articles provide accurate and timely information, please do not assume the accuracy of any particular article. This article is distributed under the terms of GNU Free Documentation License.

Copyright © 2003-2025 Farlex, Inc Disclaimer
All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional.