man pages section 1: User Commands

Exit Print View

Updated: July 2014
 
 

sum(1)

Name

sum - print checksum and block count for a file

Synopsis

/usr/bin/sum [-r] [file...]

Description

The sum lists the checksum for each of its file arguments. The standard input is read if there are no file arguments.

Options

The following option is supported:

–r

Use an alternate (machine-dependent) algorithm in computing the checksum.

Operands

The following operands are supported:

file

A path name of a file. If no files are named, the standard input is used.

Usage

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

Environment Variables

See environ(5) for descriptions of the following environment variables that affect the execution of sum: LC_CTYPE, LC_MESSAGES , and NLSPATH.

Exit Status

The following exit values are returned.

0

Successful completion.

>0

An error occurred.

Attributes

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

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/core-os
CSI
Enabled

See also

cksum(1), getconf(1), sum(1B), wc(1), libmd(3LIB), attributes(5), environ(5), largefile(5)

Diagnostics

Read error is indistinguishable from end of file on most devices. Check the block count.

Notes

Portable applications should use cksum(1). The default algorithm for this command is defined in the POSIX standard and is identical across platforms.

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