2017-10-04 18:29:42 +01:00
|
|
|
# shasum
|
|
|
|
|
|
|
|
> Calculate or check cryptographic SHA checksums.
|
|
|
|
|
|
|
|
- Calculate the SHA1 checksum for a file:
|
|
|
|
|
|
|
|
`shasum {{filename}}`
|
|
|
|
|
|
|
|
- Calculate the SHA256 checksum for a file:
|
|
|
|
|
2017-10-05 10:20:54 +01:00
|
|
|
`shasum --algorithm 256 {{filename}}`
|
2017-10-04 18:29:42 +01:00
|
|
|
|
|
|
|
- Calculate the SHA512 checksum for multiple files:
|
|
|
|
|
2017-10-05 10:20:54 +01:00
|
|
|
`shasum --algorithm 512 {{filename1}} {{filename2}}`
|
2017-10-04 18:29:42 +01:00
|
|
|
|
2020-12-18 14:17:54 +00:00
|
|
|
- Calculate and save the list of SHA256 checksums to a file:
|
2020-12-18 14:14:04 +00:00
|
|
|
|
|
|
|
`shasum --algorithm 256 {{filename1}} {{filename2}} > {{filename.sha256}}`
|
|
|
|
|
2017-10-05 10:20:54 +01:00
|
|
|
- Check a file with a list of sums against the directory's files:
|
2017-10-04 18:29:42 +01:00
|
|
|
|
2017-10-05 10:20:54 +01:00
|
|
|
`shasum --check {{list_file}}`
|
2017-10-04 18:29:42 +01:00
|
|
|
|
2020-12-20 19:34:27 +00:00
|
|
|
- Check a list of sums and only show a message for files for which verification fails:
|
2020-12-18 12:47:34 +00:00
|
|
|
|
2020-12-18 14:04:57 +00:00
|
|
|
`shasum --check --quiet {{list_file}}`
|
2020-12-18 12:47:34 +00:00
|
|
|
|
2021-01-31 17:05:18 +00:00
|
|
|
- Calculate the SHA1 checksum from stdin:
|
2017-10-04 18:29:42 +01:00
|
|
|
|
|
|
|
`{{somecommand}} | shasum`
|