1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/shasum.md

37 lines
1.1 KiB
Markdown
Raw Normal View History

2017-10-04 19:29:42 +02:00
# shasum
> Calculate SHA cryptographic checksums.
> More information: <https://manned.org/shasum>.
2017-10-04 19:29:42 +02:00
- Calculate the SHA1 checksum for one or more files:
2017-10-04 19:29:42 +02:00
`shasum {{path/to/file1 path/to/file2 ...}}`
2017-10-04 19:29:42 +02:00
- Calculate the SHA checksum for one or more files with the specified algorithm:
2017-10-04 19:29:42 +02:00
`shasum --algorithm {{1|224|256|384|512|512224|512256}} {{path/to/file1 path/to/file2 ...}}`
- Calculate a SHA1 checksum from `stdin`:
`{{command}} | shasum`
2017-10-04 19:29:42 +02:00
2020-12-18 15:17:54 +01:00
- Calculate and save the list of SHA256 checksums to a file:
`shasum --algorithm 256 {{path/to/file1 path/to/file2 ...}} > {{path/to/file.sha256}}`
- Read a file of SHA checksums and filenames and verify all files have matching checksums (the algorithm will be automatically detected):
2017-10-04 19:29:42 +02:00
2021-09-03 12:29:07 -07:00
`shasum --check {{path/to/file}}`
2017-10-04 19:29:42 +02:00
- Only show a message for missing files or when verification fails:
2020-12-18 13:47:34 +01:00
2021-09-03 12:29:07 -07:00
`shasum --check --quiet {{path/to/file}}`
2020-12-18 13:47:34 +01:00
- Only show a message when verification fails, ignoring missing files:
2017-10-04 19:29:42 +02:00
`shasum --ignore-missing --check --quiet {{path/to/file}}`
- Check a known SHA checksum of a file:
`echo {{known_sha_checksum_of_the_file}} {{path/to/file}} | shasum --check`