sha256sum

A command-line tool that prints the SHA-256 digest of files and can later check them against a saved list of digests.

In more detail

Run on files, it writes one line per file with the digest and the name, which can be saved as a manifest. Running sha256sum -c on that manifest recomputes each digest and reports, file by file, whether it still matches, so any change shows up. On macOS, where it may be missing, shasum -a 256 does the same job.

Examples

sha256sum changes.csv sample.txt results.csv > manifest.sha256
sha256sum -c manifest.sha256   # results.csv: FAILED
shasum -a 256 -c manifest.sha256

Related terms

Taught in

References