When you download a massive software binary or transfer a critical database backup across a highly unstable network connection, you must mathematically verify that the file was not corrupted during transit. Even a single dropped bit will cause the binary to crash upon execution. To force the Linux kernel to execute a cryptographic audit of the file and prove its physical integrity, you can use the legacy sum command.
Executing the Cryptographic Audit
The sum command is one of the oldest file verification engines in the Unix architecture. It reads the raw binary data of the file, mathematically calculates a simple checksum based on the byte values, and counts the exact number of 1024-byte data blocks the file occupies.
To execute the audit on a downloaded file (e.g., database.sql), type:
sum database.sql
The exact millisecond you press Enter, the engine outputs two highly specific integers. The first number is the mathematical checksum (e.g., 48291). The second number is the total physical block count (e.g., 345).
If you execute this exact command on the source server, and then execute it again on the destination server, both integers must match absolutely perfectly. If the checksum on the destination server reads 48290, you have absolute mathematical proof that the file suffered network corruption and the transfer must be aborted.
Understanding the Algorithm Limitations
CRITICAL ARCHITECTURAL WARNING: The sum command utilizes a deeply legacy, highly simplistic checksum algorithm (often BSD-compatible by default). It is mathematically designed to detect accidental network corruption (like dropped packets). It is NOT designed for security or cryptographic verification.
Because the algorithm is simplistic, a malicious hacker can easily engineer a compromised file that mathematically calculates to the exact same checksum as the original file (a collision). If you are auditing files for security breaches or malware tampering, you must absolutely abandon sum and utilize modern cryptographic hashes like sha256sum.