2017-10-04 18:29:42 +01:00
|
|
|
# shasum
|
|
|
|
|
2023-05-19 10:34:36 +01:00
|
|
|
> Calculate SHA cryptographic checksums.
|
2021-11-02 15:11:41 +00:00
|
|
|
> More information: <https://manned.org/shasum>.
|
2017-10-04 18:29:42 +01:00
|
|
|
|
2023-05-19 10:34:36 +01:00
|
|
|
- Calculate the SHA1 checksum for one or more files:
|
2017-10-04 18:29:42 +01:00
|
|
|
|
2023-05-19 10:34:36 +01:00
|
|
|
`shasum {{path/to/file1 path/to/file2 ...}}`
|
2017-10-04 18:29:42 +01:00
|
|
|
|
2023-05-19 10:34:36 +01:00
|
|
|
- Calculate the SHA256 checksum for one or more files:
|
2017-10-04 18:29:42 +01:00
|
|
|
|
2023-05-19 10:34:36 +01:00
|
|
|
`shasum --algorithm 256 {{path/to/file1 path/to/file2 ...}}`
|
2017-10-04 18:29:42 +01:00
|
|
|
|
2023-05-19 10:34:36 +01:00
|
|
|
- Calculate the SHA512 checksum for one or more files:
|
2017-10-04 18:29:42 +01:00
|
|
|
|
2023-05-19 10:34:36 +01:00
|
|
|
`shasum --algorithm 512 {{path/to/file1 path/to/file2 ...}}`
|
|
|
|
|
|
|
|
- Calculate a SHA1 checksum from `stdin`:
|
|
|
|
|
2023-05-20 03:11:11 +01:00
|
|
|
`{{command}} | shasum`
|
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
|
|
|
|
2023-05-19 10:34:36 +01:00
|
|
|
`shasum --algorithm 256 {{path/to/file1 path/to/file2 ...}} > {{path/to/file.sha256}}`
|
2020-12-18 14:14:04 +00:00
|
|
|
|
2023-05-19 10:34:36 +01:00
|
|
|
- Read a file of SHA1 sums and filenames and verify all files have matching checksums:
|
2017-10-04 18:29:42 +01:00
|
|
|
|
2021-09-03 20:29:07 +01:00
|
|
|
`shasum --check {{path/to/file}}`
|
2017-10-04 18:29:42 +01:00
|
|
|
|
2023-05-19 10:34:36 +01:00
|
|
|
- Only show a message for missing files or when verification fails:
|
2020-12-18 12:47:34 +00:00
|
|
|
|
2021-09-03 20:29:07 +01:00
|
|
|
`shasum --check --quiet {{path/to/file}}`
|
2020-12-18 12:47:34 +00:00
|
|
|
|
2023-05-19 10:34:36 +01:00
|
|
|
- Only show a message when verification fails, ignoring missing files:
|
2017-10-04 18:29:42 +01:00
|
|
|
|
2023-05-19 10:34:36 +01:00
|
|
|
`shasum --ignore-missing --check --quiet {{path/to/file}}`
|