cksum
file checksum and byte count calculator
TLDR
Calculate checksum of file
SYNOPSIS
cksum [option]... [file]...
DESCRIPTION
cksum computes a cyclic redundancy check (CRC) checksum and byte count for each specified file, or for standard input if no file is given. It is part of GNU coreutils and is commonly used to verify file integrity after transfers or copies.
By default, cksum uses the POSIX-standard 32-bit CRC algorithm. Modern versions of cksum (GNU coreutils 9.0+) support additional algorithms including MD5, SHA1, SHA256, and SHA512 via the --algorithm option, making it a versatile replacement for separate checksum utilities.
The output format includes the checksum value, byte count, and filename. When using the --check option, cksum can read previously generated checksum files and verify that the listed files have not been modified.
PARAMETERS
-a, --algorithm name
Select algorithm (crc, md5, sha1, sha256, sha512, etc.)-c, --check
Read checksums and verify them-l, --length bits
Digest length in bits--base64
Output base64-encoded digest--raw
Output raw binary digest--tag
BSD-style checksum (default)--untagged
Reversed style without digest type-z, --zero
End lines with NUL instead of newline--ignore-missing
Don't fail for missing files during check--quiet
Don't print OK for verified files--status
Silent mode, exit code shows result-w, --warn
Warn about malformed checksum lines
OUTPUT FORMAT
CAVEATS
CRC32 is not cryptographically secure. Use SHA256 or stronger for security-critical verification. Reads stdin when no file given or file is -.
