cksum is a Unix utility designed to generate a checksum for one or more files using the CRC algorithm specified in the POSIX standard. It can be used to verify data integrity by comparing the checksum of the source file with the checksum of the target file.
Content
Description
At the input, this ulit accepts a file or several files of any type and writes one line to the standard output device for each specified file in the following form:
% u% d% s \ n <checksum>, <file size in bytes>, <file name>
If successful, returns zero, otherwise returns a non-zero value.
Syntax
cksum [ file_1, file_2 ... ]
Usage Example
To calculate the checksum testfile1, you must run the following command:
cksum testfile1
After which the following will be displayed:
1263453430 78 testfile1
Usage
The cksum utility is usually used to quickly compare two files with each other, for example, to make sure that the transferred files are not damaged. But this comparison cannot be completely cryptographically secure (although it protects against accidental damage, it is easy for an attacker to intentionally damage a file so that its checksum does not change). But at the same time, the chances that the damaged file will have the same CRC as the original are small, but remain.
See also
- sha1sum
- md5sum
- tthsum