Files
tldr/pages.zh/common/sha256sum.md

32 lines
964 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# sha256sum
> 计算SHA256加密校验和。
> 更多信息:<https://www.gnu.org/software/coreutils/manual/html_node/sha2-utilities.html>。
- 计算一个或多个文件的SHA256校验和
`sha256sum {{path/to/file1 path/to/file2 ...}}`
- 计算并将SHA256校验和列表保存到文件中
`sha256sum {{path/to/file1 path/to/file2 ...}} > {{path/to/file.sha256}}`
-`stdin`计算SHA256校验和
`{{command}} | sha256sum`
- 读取一个包含SHA256校验和和文件名的文件并验证所有文件的校验和是否匹配
`sha256sum --check {{path/to/file.sha256}}`
- 仅在缺少文件或验证失败时显示消息:
`sha256sum --check --quiet {{path/to/file.sha256}}`
- 仅在验证失败时显示消息,忽略缺少的文件:
`sha256sum --ignore-missing --check --quiet {{path/to/file.sha256}}`
- 检查已知文件的SHA256校验和
`echo {{known_sha256_checksum_of_the_file}} {{path/to/file}} | sha256sum --check`