Forrest logo
back to the md5sum tool

md5sum:tldr:743d5

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

The command md5sum --check ${filename-md5} is used to verify the integrity of a file by comparing its MD5 checksum value with the one stored in a separate file.

Here's what each part of the command does:

  • md5sum: It is a command-line utility used to calculate and display the MD5 checksum (a unique cryptographic hash value) of a file. The MD5 checksum is a 32-character string that represents the file's contents.

  • --check: This option is used to compare MD5 checksum values. It allows you to verify if the calculated MD5 checksum matches a given value.

  • ${filename-md5}: This represents the name of the file containing the MD5 checksum value, usually stored in a separate file. You need to replace ${filename-md5} with the actual filename or path to the file.

To use this command, you typically perform the following steps:

  1. Generate the MD5 checksum of the file you want to verify using the md5sum command: md5sum <file>.

  2. Save the calculated MD5 checksum value in a separate file, which could be named something like filename.md5.

  3. Use the md5sum --check command with the path to the MD5 checksum file: md5sum --check filename.md5.

The command will compare the calculated MD5 checksum with the one stored in filename.md5 and display whether they match or not. If they match, it indicates that the file has not been modified or corrupted. If they don't match, it signifies that the file has been altered or corrupted in some way.

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 md5sum tool