Cksum

From LQWiki
Jump to: navigation, search

cksum prints CRC checksum and byte counts of each file.

cksum can be used to check if files are transfered without error (or not corrupted during storage).

cksum * > cksum.list

generates checksums' file. After transfer (or after a long storage) you can check if files are the same:

cksum * cksum.list-2
diff cksum.list cksum.list-2

cksum also can be used for fast searching for duplicates. After issuing

cksum *

identical files have same checksums.

Conversely, files with same chcecksums and same sizes almost always are identical. This can be checked further with diff.

Provided by

Most (all?) Linux distributions incorporate this from the GNU Coreutils: and use its man page


Related commands

These are related to summarizing the contents of files.

See also