40 lines
1.1 KiB
Groff
40 lines
1.1 KiB
Groff
.Dd 2020-09-20
|
|
.Dt sum 1
|
|
.Os HitchHiker linux
|
|
.Sh NAME
|
|
.Nm sum
|
|
.Nd checksum and count the blocks in a file
|
|
.Sh SYNOPSIS
|
|
.Nm
|
|
[\fI\,OPTION\/\fR]
|
|
[\fI\,FILE\/\fR]
|
|
.Sh DESCRIPTION
|
|
Print checksum and block counts for each
|
|
.Ar FILE.
|
|
With no
|
|
.Ar FILE,
|
|
read standard input.
|
|
.Bl -tag -width Ds
|
|
.It Fl h
|
|
print a terse usage statement and exit.
|
|
.It Fl r
|
|
use BSD sum algorithm, use 1K blocks [default]
|
|
.It Fl s
|
|
use System V sum algorithm, use 512 bytes blocks.
|
|
.Sh ORIGIN
|
|
Much of the code is derived from /usr/src/cmd/sum.c, Unix 7th Edition,
|
|
ported to modern systems by Gunnar Ritter as part of the Heirloom
|
|
Toolchest in 2003. This version has been further modified in 2020 to use
|
|
POSIX getopt for argument parsing and to more closely match the behavior
|
|
of the sum utility as implemented in GNU coreutils, and for greater ease
|
|
of maintenance.
|
|
.Sh NOTES
|
|
This utility is provided mainly for compatability reasons. The System V
|
|
algorithm is unable to detect added or missing NUL bytes. while the BSD
|
|
algorithm may produce different results in different implementations.
|
|
For these reasons,
|
|
.Ar cksum(1)
|
|
is preferable to use in new scripts.
|
|
.Sh SEE ALSO
|
|
cksum(1), wc(1), md5sum(1)
|