手册页部分 1: 用户命令

退出打印视图

更新时间: 2014 年 7 月
 
 

sum(1B)

名称

sum - calculate a checksum for a file

用法概要

/usr/ucb/sum file...

描述

sum calculates and displays a 16-bit checksum for the named file and displays the size of the file in kilobytes. It is typically used to look for bad spots, or to validate a file communicated over some transmission line. The checksum is calculated by an algorithm which may yield different results on machines with 16-bit ints and machines with 32-bit ints, so it cannot always be used to validate that a file has been transferred between machines with different-sized ints.

用法

See largefile(5) for the description of the behavior of sum when encountering files greater than or equal to 2 Gbyte ( 231 bytes).

属性

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
compatibility/ucb

另请参见

sum(1), wc(1), attributes (5), largefile (5)

诊断

Read error is indistinguishable from EOF on most devices; check the block count.

附注

sum and /usr/bin/sum (see sum(1)) return different checksums.

This command is obsolete and will be removed in a future release of Oracle Solaris. See sum(1) for an alternate implementation of this command. Note that there are blocksize and algorithm differences between sum(1B) and sum(1). The command sum(1) uses 512 btye block sizes while sum(1B) uses 1024 byte block sizes.