sha256sum
ファイルとディレクトリ
書き方
sha256sum [file]ファイルの SHA-256 の指紋を出し、ダウンロードが無事かを照合させます。一致は中身が同じという証明で、配布元が信用できるという証明ではありません。
よく使うオプション
| オプション | 意味 |
|---|---|
| -c | Read a list of hashes and check each file against it |
| -b | Binary mode, which matters on Windows-style line endings |
| --tag | GNU: print in the BSD format, SHA256 (file) = hash |
| --ignore-missing | GNU: with -c, skip files that are not there |
| shasum -a 256 | The same digest where sha256sum is missing, as on older macOS |
例
sha256sum ubuntu.isoPrints the hash to compare with the download page.
sha256sum -c SHA256SUMSVerifies every file named in the checksum list.
shasum -a 256 ubuntu.isoThe portable macOS spelling.
移したり消したり探したりするものです。聞き返してくれない命令が混ざっているので、-i を付ける癖が手を守ります。
読み方
- 角括弧 [ ] は省いてよい部分です。
- 三点 … は複数並べられるという意味です。
- オプションは大文字小文字を区別します — -r と -R が別物のコマンドもあります。
よくある質問
Q. sha256sum は何をしますか。
ファイルの SHA-256 の指紋を出し、ダウンロードが無事かを照合させます。一致は中身が同じという証明で、配布元が信用できるという証明ではありません。
Q. どう打ちますか。
sha256sum [file] — 角括弧は省いてよい部分です。
Q. よく使うオプションはいくつですか。
ここにまとめたのは5個です。全部は man sha256sum にあります。このコマンドはファイルとディレクトリの仲間です。
関連するコマンド
man ページ: man sha256sum