LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

sum

Compute legacy file checksums and block counts

TLDR

Calculate checksum using BSD algorithm (default)
$ sum [file]
copy
Use System V algorithm with 512-byte blocks
$ sum -s [file]
copy
Explicitly use BSD algorithm with 1K blocks
$ sum -r [file]
copy
Read from stdin
$ cat [file] | sum
copy

SYNOPSIS

sum [options] [file...]

DESCRIPTION

sum prints checksum and block counts for each FILE. With no FILE, or when FILE is -, reads standard input. The default BSD algorithm uses 1024-byte blocks, while the System V algorithm uses 512-byte blocks.This is a legacy utility provided for compatibility. The cksum command is preferred for new applications.

PARAMETERS

-r

Use BSD algorithm, use 1K blocks (default)
-s, --sysv
Use System V algorithm, use 512-byte blocks
--help
Display help and exit
--version
Output version information and exit

CAVEATS

Not cryptographically secure. Use sha256sum or similar for integrity verification. The checksum algorithm is not suitable for detecting intentional data tampering.

SEE ALSO

cksum(1), md5sum(1), sha256sum(1)

Copied to clipboard
Kai