'\" te .\" Copyright (c) 1992, X/Open Company Limited All Rights Reserved .\" Copyright 1989 AT&T .\" Portions Copyright (c) 2009, 2011, Oracle and/or its affiliates.All rights reserved. .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation.Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/. .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation.In the following statement, the phrase "this text" refers to portions of the system documentation.Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group.In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document.The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.This notice shall appear on any product containing this material. .TH sum 1 "2011 年 7 月 28 日" "SunOS 5.11" "用户命令" .SH 名称 sum \- 打印文件的校验和和块计数 .SH 用法概要 .LP .nf \fB/usr/bin/sum\fR [-r] [\fIfile\fR...] .fi .SH 描述 .sp .LP \fBsum\fR 会列出每个文件参数的校验和。如果没有文件参数,则读取标准输入。 .SH 选项 .sp .LP 支持以下选项: .sp .ne 2 .mk .na \fB\fB-r\fR\fR .ad .RS 6n .rt 在计算校验和时使用备用算法(取决于计算机)。 .RE .SH 操作数 .sp .LP 支持下列操作数: .sp .ne 2 .mk .na \fB\fIfile\fR\fR .ad .RS 8n .rt 文件的路径名。如果未命名任何文件,则使用标准输入。 .RE .SH 用法 .sp .LP 有关 \fBsum\fR 遇到大于或等于 2 GB(2^31 字节)文件时行为的说明,请参见 \fBlargefile\fR(5)。 .SH 环境变量 .sp .LP 有关影响 \fBsum\fR 执行执行的以下环境变量的说明,请参见 \fBenviron\fR(5):\fBLC_CTYPE\fR、\fBLC_MESSAGES \fR 和 \fBNLSPATH\fR。 .SH 退出状态 .sp .LP 将返回以下退出值。 .sp .ne 2 .mk .na \fB\fB0\fR\fR .ad .RS 6n .rt 成功完成。 .RE .sp .ne 2 .mk .na \fB\fB>0\fR\fR .ad .RS 6n .rt 出现错误。 .RE .SH 属性 .sp .LP 有关下列属性的说明,请参见 \fBattributes\fR(5): .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . 属性类型属性值 _ 可用性system/core-os _ CSIEnabled(已启用) .TE .SH 另请参见 .sp .LP \fBcksum\fR(1)、\fBgetconf\fR(1)、\fBsum\fR(1B)、\fBwc\fR(1)、\fBlibmd\fR(3LIB)、\fBattributes\fR(5)、\fBenviron\fR(5)、\fBlargefile\fR(5) .SH 诊断 .sp .LP 不能从大多数设备上的文件结尾中区分\fB读取错误\fR。请检查块计数。 .SH 附注 .sp .LP 可移植应用程序应使用 \fBcksum\fR(1)。此命令的缺省算法定义在 POSIX 标准中且在所有平台中都相同。 .sp .LP \fBsum\fR 和 \fBusr/ucb/sum\fR(请参见 \fBsum\fR(1B))会返回不同的校验和。