cksum is a command in Unix-like operating systems that generates a checksum value for a file or stream of data. The cksum command reads the file or files specified as arguments, or standard input if no arguments are provided, and calculates a checksum value, cyclic redundancy check (CRC) and the byte count. The checksum, number of bytes, and file name are written to standard output.
The cksum command can be used to verify the equality of two files on different computers, such as a copy made over noisy transmission lines.[1]. (If the files are on the same computer, equality can be verified with the cmp command.) The comparison made by the cksum command is not cryptographically secure. However, it is unlikely that an accidentally damaged file will produce the same checksum as the original file.
Contents |
Interoperability
The standard cksum command, as found on most UNIX-like OS (including GNU/Linux, *BSD, Mac OS X, and Solaris) uses a CRC algorithm based on the ethernet standard frame check and is therefore interoperable between implementations. This is in contrast to the sum command, which is not as interoperable. On Tru64 operating systems, the cksum command returns a different CRC value, unless the environment variable CMD_ENV is set to “xpg4”.
Syntax
cksum [ File ... ]
Usage example
$ cksum test.txt 4038471504 75 test.txt $
4038471504 => This represents the check sum value
75 => This represents the file size of test.txt
References
See also
|
|
This article does not cite any references or sources. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed. (January 2008) |
|
||||||||||||||||||||||||||
| This Unix-related article is a stub. You can help Wikipedia by expanding it. |
This entry is from Wikipedia, the leading user-contributed encyclopedia. It may not have been reviewed by professional editors (see full disclaimer)




