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
-cReads checksums from a file and checks that the listed files match.
--quietWith -c, does not print files that match; only the ones that fail.
--statusWith -c, prints nothing and reports the result only in the exit status.
--ignore-missingWith -c, does not fail for missing files.
--tagWrites the checksum in BSD format, with the algorithm name.
-bReads the file in binary mode.
Usage examples
sha256sum debian.isoPrints the image's SHA-256 checksum to compare it with the published one.
sha256sum *.txt > sumas.txtSaves the checksums of all the .txt files into a file.
sha256sum -c sumas.txtChecks that none of them changed.
sha256sum -c --ignore-missing SHA256SUMSChecks 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.