2018-09-15 13:52:48 +01:00
|
|
|
# b2sum
|
|
|
|
|
|
|
|
> Calculate BLAKE2 cryptographic checksums.
|
2024-12-09 21:11:08 -08:00
|
|
|
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/b2sum-invocation.html>.
|
2018-09-15 13:52:48 +01:00
|
|
|
|
2023-05-19 11:34:36 +02:00
|
|
|
- Calculate the BLAKE2 checksum for one or more files:
|
2018-09-15 13:52:48 +01:00
|
|
|
|
2023-05-19 11:34:36 +02:00
|
|
|
`b2sum {{path/to/file1 path/to/file2 ...}}`
|
2018-09-15 13:52:48 +01:00
|
|
|
|
2023-05-19 11:34:36 +02:00
|
|
|
- Calculate and save the list of BLAKE2 checksums to a file:
|
2018-09-15 13:52:48 +01:00
|
|
|
|
2023-05-19 11:34:36 +02:00
|
|
|
`b2sum {{path/to/file1 path/to/file2 ...}} > {{path/to/file.b2}}`
|
2018-09-15 13:52:48 +01:00
|
|
|
|
2023-05-19 11:34:36 +02:00
|
|
|
- Calculate a BLAKE2 checksum from `stdin`:
|
2022-03-28 16:21:41 +02:00
|
|
|
|
2023-05-20 04:11:11 +02:00
|
|
|
`{{command}} | b2sum`
|
2022-03-28 16:21:41 +02:00
|
|
|
|
2024-11-23 22:45:05 +01:00
|
|
|
- Read a file of BLAKE2 checksums and filenames and verify all files have matching checksums:
|
2018-09-15 13:52:48 +01:00
|
|
|
|
2022-03-28 16:21:41 +02:00
|
|
|
`b2sum --check {{path/to/file.b2}}`
|
2018-09-15 13:52:48 +01:00
|
|
|
|
2022-03-28 16:21:41 +02:00
|
|
|
- Only show a message for missing files or when verification fails:
|
2018-09-15 13:52:48 +01:00
|
|
|
|
2022-03-28 16:21:41 +02:00
|
|
|
`b2sum --check --quiet {{path/to/file.b2}}`
|
|
|
|
|
2023-05-19 11:34:36 +02:00
|
|
|
- Only show a message when verification fails, ignoring missing files:
|
2022-03-28 16:21:41 +02:00
|
|
|
|
|
|
|
`b2sum --ignore-missing --check --quiet {{path/to/file.b2}}`
|
2024-11-23 22:45:05 +01:00
|
|
|
|
|
|
|
- Check a known BLAKE2 checksum of a file:
|
|
|
|
|
|
|
|
`echo {{known_blake2_checksum_of_the_file}} {{path/to/file}} | b2sum --check`
|