maux
Star on GitHub Buy me a coffee

Manual / cksum

cksum(1)

CKSUM(1) General Commands Manual CKSUM(1)

cksum - write a file checksum and byte count

cksum [ file ] ...

Cksum computes a cyclic redundancy check for each named file (standard input if none is given) and writes, for each one, the checksum, the number of octets read, and — if an operand named it — the file's own pathname, one line per file. A run with no operands prints no pathname at all, matching every other checksum-shaped tool in this tree (sum(1)). Unlike sum(1), cksum prints a pathname for EVERY named operand, even a single one.

The checksum is the CRC used by the POSIX cksum utility: a 32-bit CRC (polynomial 04C11DB7, most-significant bit first, initial value zero) computed over the file's own bytes, then over the octets of the file's length itself (least significant octet first, stopping the instant the remaining length is zero — an empty file folds in none), and finally complemented. This is not the same algorithm as zlib's CRC-32.

/usr/man/CKSUM this page

sum(1)

Exit status is 0; 1 if a file named on the command line could not be opened — that file is skipped, a diagnostic naming it is written to standard error, and the remaining operands are still processed.

None known.

September 14, 2026 maux