compute checksum and byte count for file 



cksum [-ciprt] [file ...]


cksum calculates and displays a checksum for each input file. A checksum is an error-checking technique used by many programs as a quick way to compare files that have been moved from one location to another to ensure that no data has been lost. cksum also displays the number of eight-bit bytes in each file. If you do not specify any files or you specify - as the file name, cksum reads the standard input.

cksum differs from sum only in the format of the output. cksum's output has the form

checksum    bytecount    filename

where bytecount is the number of bytes in the file.

cksum can calculate checksums in a variety of ways. The default (if no options are specified on the command line) is compatible with the POSIX.2 standard. You can specify other algorithms by specifying options. The POSIX standard does not recognize these algorithms; they are provided for compatibility with the sum command.

cksum accepts only one algorithm at a time. If the user specifies more than one of the -c, -i, -p, or -r options, cksum uses the last option on the command line.



uses a standard 16-bit Cyclical Redundancy Check (CRC-16).


uses the CCITT standard Cyclic Redundancy Check (CRC-CCITT). Data communications network protocols often use a cyclic redundancy check to ensure proper transmission. This algorithm is more likely to produce a different sum for inputs -- the only difference is byte order.


uses the POSIX.2 checksum algorithm. This is the default.


enables the use of an alternate checksum algorithm (16-bit rotate and add), which has the advantage of being sensitive to byte order.


produces a line containing the total number of bytes of data read as well as the checksum of the concatenation of the input files.


Possible exit status values are:


Successful completion.


Failure due to any of the following:

— inability to open input file
— an error reading the input file

Unknown command line option.


POSIX.2. x/OPEN Portability Guide 4.0. Windows 8.1. Windows Server 2012 R2. Windows 10. Windows Server 2016. Windows Server 2019. Windows 11. Windows Server 2022.

All of the listed options are extensions to the POSIX standard.


PTC MKS Toolkit for Power Users
PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


cmp, diff, ls, sum, wc

PTC MKS Toolkit 10.4 Documentation Build 39.