utility
sha256sum
Compute SHA-256 digests or verify a recorded list. Nonzero on failed verification. Trust in expected digest is required for authenticity.
Formal Syntax & Structure
bash syntaxbash
sha256sum FILE ...; sha256sum -c CHECKFILEParameters & Attributes
| Name | Type | Description |
|---|---|---|
| FILE | path | Data to hash. |
| CHECKFILE | path | Digest list when using -c. |
Return Value
exit status
Exit status 0 on success; nonzero indicates failure or a command-specific condition. See description and example.
Working Example
Example Snippetbash
printf 'ready\n' > report.txtsha256sum report.txt > checksums.txtsha256sum -c checksums.txt