cksum
From Wikipedia, the free encyclopedia
This article needs additional citations for verification. Please help improve this article by adding reliable references. Unsourced material may be challenged and removed. (January 2008) |
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 |
[edit] 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
”.
[edit] Syntax
cksum [ File ... ]
[edit] Usage example
$ cksum test.txt 4038471504 75 test.txt $
"4038471504" represents the checksum value. "75" represents the file size of test.txt.
[edit] References
[edit] See also
[edit] External links
- The Single UNIX® Specification, Issue 7 from The Open Group : write file checksums and sizes – Commands & Utilities Reference,
|
This Unix-related article is a stub. You can help Wikipedia by expanding it. |