Sortix main manual
This manual documents Sortix main. You can instead view this document in the latest official manual.
NAME
checksum sha224sum sha256sum sha384sum sha512sum — compute and check cryptographic hashesSYNOPSIS
checksum | [-ciqs] -a algorithm [-C checklist] [file ...] |
sha224sum | [-ciqs] [-C checklist] [file ...] |
sha256sum | [-ciqs] [-C checklist] [file ...] |
sha384sum | [-ciqs] [-C checklist] [file ...] |
sha512sum | [-ciqs] [-C checklist] [file ...] |
DESCRIPTION
checksum is used to check the cryptographic integrity of files by calculating their cryptographic hashes and later check the files retain the same hash, thus guaranteeing it would be vanishingly unlikely the files have been modified unless the cryptographic hash algorithm has been broken.- -a, --algorithm=algorithm
-
Use the case-insensitive cryptographic hash algorithm:
- SHA224
- SHA256
- SHA384
- SHA512/256
- SHA512
- -c, --check
- Each input is interpreted as a checklist of files to be checked.
- -C, --checklist=checklist
- Check the inputs using the checklist file (‘-’ for the standard input). This option is useful for checking a subset of files in a checklist.
- -i, --ignore-missing
- Ignore non-existent files when checking.
- -q, --quiet
- Only mention files with the wrong hash when checking.
- -s, --status
- Don't mention any files when checking and only provide the exit status.
EXIT STATUS
If -c or -C are set, checksum will exit 1 if any error occurred or the checklist was malformed; and otherwise exit 2 if any files had the wrong hash, and exit 0 if all files passed the check.EXAMPLES
Compute the SHA256 hash of a file:$ sha256sum foo b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c foo
$ sha256sum foo > foo.sha256sum $ sha256sum -c foo.sha256sum foo: OK
$ echo foo > foo $ echo bar > bar $ sha256sum foo bar > checklist $ sha256sum -cq checklist $ echo foo > bar $ sha256sum -cq checklist bar: FAILED sha256sum: WARNING: 1 computed checksum did NOT match
$ sha256sum foo bar qux > checklist $ sha256sum -C checklist foo qux foo: OK qux: OK
$ sha256sum < reference > checklist $ sha256sum -C checklist < input -: OK