blob: b95851db03bff2ee33b4b762a37445e4d4a05f2b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
.TH SUM 1
.SH NAME
sum, md5sum, sha1sum \- sum and count blocks in a file
.SH SYNOPSIS
.B sum
[
.B -5r
]
[
.I file ...
]
.PP
.B md5sum
[
.I file ...
]
.PP
.B sha1sum
[
.I file ...
]
.SH DESCRIPTION
By default,
.I sum
calculates and prints a 32-bit hexadecimal checksum,
a byte count,
and the name of
each
.IR file .
The checksum is also a function of the input length.
If no files are given,
the standard input is
summed.
Other summing algorithms are available.
The options are
.TP
.B -r
Sum with the algorithm of System V's
.B "sum -r"
and print the length (in 1K blocks) of the input.
.TP
.B -5
Sum with System V's default algorithm
and print the length (in 512-byte blocks) of the input.
.PP
.I Sum
is typically used to look for bad spots,
to validate a file communicated over
some transmission line or
as a quick way to determine if two files on different machines might be the same.
.PP
.B Md5sum
computes the 32 hex digit RSA Data Security, Inc. MD5 Message-Digest Algorithm
described in RFC1321.
If no
.I files
are given,
the standard input is
summed.
.PP
.B Sha1sum
computes the 40 hex digit National Institute of Standards and Technology SHA1 secure hash algorithm
described in FIPS PUB 180-1.
If no
.I files
are given,
the standard input is
summed.
.SH SOURCE
.B \*9/src/cmd/sum.c
.br
.B \*9/src/cmd/md5sum.c
.br
.B \*9/src/cmd/sha1sum.c
.SH "SEE ALSO"
.IR cmp (1),
.IR wc (1)
|