Forrest logo
back to the sha256sum tool

sha256sum:tldr:de234

sha256sum: Read a file of SHA256 sums and filenames and verify all files have matching checksums.
$ sha256sum --check ${filename-sha256}
try on your machine

This command is using the sha256sum utility to verify the integrity and authenticity of a file by comparing its SHA-256 hash value with the provided hash value.

Here's a breakdown of the command:

  • sha256sum: This is a command-line utility used to calculate the SHA-256 hash value of a file. It takes a file as input and generates a 256-bit hash value.

  • --check: This flag specifies that the command should perform a verification check.

  • ${filename-sha256}: This is a variable that represents the filename and its associated SHA-256 hash value. It is usually in the format of "filename-sha256", where "filename" is the name of the file, and "sha256" is the corresponding SHA-256 hash value.

So, when you execute this command, it will calculate the SHA-256 hash value of the file specified by "filename", and then compare it with the provided hash value stored in a file named "filename-sha256". If the calculated hash value matches the provided one, the command will output the file name and a "OK" status, indicating that the file has not been altered. If the hash values don't match, it will output the file name and a "FAILED" status, indicating that the file has been tampered with or corrupted.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the sha256sum tool