![find corrupted files unix find corrupted files unix](https://www.journaldev.com/wp-content/uploads/2020/03/boot-repair.png)
![find corrupted files unix find corrupted files unix](https://www.cgsecurity.org/mw/images/PhotoRec_dst.png)
Therefore, if you need to be absolutely certain that a file is identical to the original, use a more powerful method. It's been proven that an attacker could carefully make changes to a file that would produce an identical cksum checksum. It's not meant to protect against malicious alteration of a file. Simple checksums, such as those produced by the cksum tool, are useful only for detecting accidental data corruption. and it changes dramatically even if only one character is different: This is my original file? cksum myfile.txt 3832066352 26 myfile.txt The checksum is different even if the number of bytes is same as the original: This is a corrupted file. The checksum is very different, and we can also see that there are ten more bytes of data. and run cksum again, you see the following: cksum myfile.txt 632554699 36 myfile.txt If you change the contents of the file to this: This is no longer my original file. Here, 4164605383 is the checksum, and 26 is the amount of data, in bytes. and this is the output: 4164605383 26 myfile.txt You can calculate the checksum using cksum: cksum myfile.txt Let's say you have a file, myfile.txt, containing the following text: This is my original file.
![find corrupted files unix find corrupted files unix](https://www.linuxshelltips.com/wp-content/uploads/2021/10/Linux-fstab-File.png)
If the checksum value of the file is the same before and after being transferred, it is unlikely that any data corruption has accidentally occurred - from signal noise, for example. The checksum of a file is a simple way to check if its data has become corrupted when being transferred from one place to another.