Go to main content

マニュアルページ セクション 1: ユーザーコマンド

印刷ビューの終了

更新: 2022年7月27日
 
 

sum(1)

名前

sum - ファイルのチェックサムおよびブロックカウントの出力

形式

/usr/bin/sum [-r] [file...]

説明

sum は、各ファイル引数のチェックサムを一覧表示します。ファイル引数が指定されていない場合は、標準入力から読み取られます。

オプション

次のオプションがサポートされています。

–r

チェックサムの計算には、代替 (マシン依存型) アルゴリズムを使用します。

オペランド

次のオペランドがサポートされています。

file

ファイルのパス名。ファイルの指定がない場合は、標準入力を使用します。

環境変数

See environ(7) for descriptions of the following environment variables that affect the execution of sum: LC_CTYPE, LC_MESSAGES, and NLSPATH.

終了ステータス

次の終了値が返されます。

0

正常終了。

> 0

エラーが発生しました。

属性

属性についての詳細は、マニュアルページの attributes(7) を参照してください。

属性タイプ
属性値
使用条件
system/core-os
CSI
有効

関連項目

cksum(1), digest(1), getconf(1), wc(1), libmd(3LIB), attributes(7), environ(7)

診断

大部分のデバイスでは、読み取りエラーとファイルの終わりとを区別できません。ブロック数をチェックしてください。

移植性の必要なアプリケーションには cksum(1) を使用してください。このコマンドのデフォルトアルゴリズムは POSIX 標準に定義されていて、プロットフォーム間で同一です。

The sum command is typically used to quickly compare a suspect file against a trusted version of the same, such as to ensure that files transmitted over noisy media arrive intact.ただし、この比較は、暗号化した場合ほど安全ではありません。When compatibility with existing sum usage or values is not required, the digest(1) command is recommended instead, as it provides more modern and secure algorithms.

In previous releases of Solaris, there was a /usr/ucb/sum that returned a different checksum than the sum command described here due to different blocksizes and algorithms used.The command sum uses 512 byte block sizes while /usr/ucb/sum used 1024 byte block sizes.