Commands.page Logo

How to Check File Integrity Using Checksums in Ubuntu

Ensuring downloaded files are secure and uncorrupted is essential for maintaining a stable Ubuntu system. This guide provides a direct explanation of the commands used to verify file integrity through checksums. You will learn how to generate hash values and compare them against official sources to confirm your files have not been tampered with or damaged during transfer.

The primary command to check file integrity using checksums in Ubuntu is sha256sum. While older methods like md5sum exist, SHA-256 is the current standard for security. To generate a checksum, open your terminal and type sha256sum followed by the filename. This outputs a long string of characters unique to that file.

To verify a file, you need the expected checksum provided by the developer. Compare the generated string with the official one. If they match exactly, the file is intact. If they differ, the file is corrupted or compromised and should not be used. You can also use the -c flag with a checksum file to automate this verification process.