sha256sum

Linux · Files · reference only

What it does

Computes and verifies SHA-256 checksums. It is the usual way to verify downloads such as ISO images.

Syntax

sha256sum [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

  • sha256sum debian.iso

    Prints the image's SHA-256 checksum to compare it with the published one.

  • sha256sum *.txt > sumas.txt

    Saves the checksums of all the .txt files into a file.

  • sha256sum -c sumas.txt

    Checks that none of them changed.

  • sha256sum -c --ignore-missing SHA256SUMS

    Checks only the files from the list that you have downloaded.

Notes and common mistakes

  • Always compare with a checksum published by a trusted source, through a different channel from the download.

Related commands