sha256sum

ファイルとディレクトリ

書き方

sha256sum [file]

ファイルの SHA-256 の指紋を出し、ダウンロードが無事かを照合させます。一致は中身が同じという証明で、配布元が信用できるという証明ではありません。

よく使うオプション

オプション意味
-cRead a list of hashes and check each file against it
-bBinary mode, which matters on Windows-style line endings
--tagGNU: print in the BSD format, SHA256 (file) = hash
--ignore-missingGNU: with -c, skip files that are not there
shasum -a 256The same digest where sha256sum is missing, as on older macOS

sha256sum ubuntu.iso

Prints the hash to compare with the download page.

sha256sum -c SHA256SUMS

Verifies every file named in the checksum list.

shasum -a 256 ubuntu.iso

The portable macOS spelling.

移したり消したり探したりするものです。聞き返してくれない命令が混ざっているので、-i を付ける癖が手を守ります。

読み方

  • 角括弧 [ ] は省いてよい部分です。
  • 三点 … は複数並べられるという意味です。
  • オプションは大文字小文字を区別します — -r と -R が別物のコマンドもあります。

よくある質問

Q. sha256sum は何をしますか。

ファイルの SHA-256 の指紋を出し、ダウンロードが無事かを照合させます。一致は中身が同じという証明で、配布元が信用できるという証明ではありません。

Q. どう打ちますか。

sha256sum [file] — 角括弧は省いてよい部分です。

Q. よく使うオプションはいくつですか。

ここにまとめたのは5個です。全部は man sha256sum にあります。このコマンドはファイルとディレクトリの仲間です。

関連するコマンド

man ページ: man sha256sum