Go to main content

man pages section 1: User Commands

Exit Print View

Updated: Thursday, June 13, 2019
 
 

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.

Environment Variables

See environ(7) 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(7) for descriptions of the following attributes:

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

See Also

cksum(1), getconf(1), wc(1), libmd(3LIB), attributes(7), environ(7)

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.

In previous releases of Solaris, there was a usr/ucb/sum that returned a different checksum than the sum command described here due to different blocksizes and algorithms used. The command sum uses 512 btye block sizes while /usr/ucb/sum used 1024 byte block sizes.