cksum file - verify file was intact

For example, we executed the following command in our case:
cksum file1
Here's the above command in action:
So the first number in the output is the checksum, the second number is the number of bytes, and third entity - needless to say - is the input file name.
Next, what we did was, we made a slight change in the file text, and executed the same command again:
So as you can see, the checksum got changed, indicating that there's has been some change in the file.
That's pretty much it about this tool. It does offer a couple of options, but those are pretty generic (--help and --version) - they are not only self-explanatory, but can also be found in almost every command's option list in Linux.

Conclusion

The cksum command is simple to understand and even simpler to use. You can easily try it on your system - if there's a file for which the corresponding CRC checksum is known, this tool can be used to verify that the file is intact. For more information on cksum, head to the tool's info page (run the command: info coreutils cksum), instead of its man page.

Comments

Popular posts from this blog

HAproxy logging

teamcity Automatic Agent Start under Linux

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all