md5sum

Linux · Files · reference only

What it does

Computes and verifies MD5 checksums, which are used to detect whether a file got corrupted or changed.

Syntax

md5sum [opciones] [fichero...]

Options and parameters

  • -c

    Reads checksums from a file and checks that the listed files match.

  • --quiet

    With -c, does not print files that match; only the ones that fail.

  • --status

    With -c, prints nothing and reports the result only in the exit status.

  • --ignore-missing

    With -c, does not fail for missing files.

  • --tag

    Writes the checksum in BSD format, with the algorithm name.

  • -b

    Reads the file in binary mode.

Usage examples

  • md5sum archivo.iso

    Prints the file's MD5 checksum and its name.

  • md5sum a.txt b.txt > sumas.md5

    Saves the checksums of several files into a file.

  • md5sum -c sumas.md5

    Checks the files have not changed since the checksums were computed.

  • md5sum -c --quiet sumas.md5

    Same, but only warns about the ones that do not match.

Notes and common mistakes

  • MD5 detects accidental damage, but it is not safe against deliberate tampering: use sha256sum for that.

Related commands