使用法: cmp [オプション]... ファイル1 [ファイル2 [スキップ1 [スキップ2]]]
2つのファイルをバイトごとに比較します。
-b --print-bytes 異なるバイトを表示。
-i SKIP --ignore-initial=SKIP 入力の先頭SKIPバイトをスキップ。
-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2
FILE1のSKIP1バイトとFILE2のSKIP2バイトをスキップ。
-l --verbose すべての異なるバイトの指数と値を出力。
-n LIMIT --bytes=LIMIT 高々LIMITバイトを比較。
-s --quiet --silent 出力なし。終了ステータスのみ。
-v --version バージョン情報を出力。
--help この説明を出力。
「スキップ1」と「スキップ2」は、各ファイルをスキップするバイト数。
スキップの値には、次の係数を続けることもできます。
kB 1000、K 1024、MB 1,000,000、M 1,048,576、
GB 1,000,000,000、G 1,073,741,824、またT、P、E、Z、Yについても同様。
もしファイルがないか「-」のとき、標準入力を読みます。
バグを見つけたら
Usage: cmp [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]
Compare two files byte by byte.
-b --print-bytes Print differing bytes.
-i SKIP --ignore-initial=SKIP Skip the first SKIP bytes of input.
-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2
Skip the first SKIP1 bytes of FILE1 and the first SKIP2 bytes of FILE2.
-l --verbose Output byte numbers and values of all differing bytes.
-n LIMIT --bytes=LIMIT Compare at most LIMIT bytes.
-s --quiet --silent Output nothing; yield exit status only.
-v --version Output version info.
--help Output this help.
SKIP1 and SKIP2 are the number of bytes to skip in each file.
SKIP values may be followed by the following multiplicative suffixes:
kB 1000, K 1024, MB 1,000,000, M 1,048,576,
GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y.
If a FILE is `-' or missing, read standard input.
Report bugs to
CMP(1) CMP(1)
名前
cmp - 2 つのファイルを 1 バイトずつ比較する
書式
cmp [-bls] [-i BYTES[:BYTES2]] [-n BYTES] [--bytes BYTES]
[--ignore-initial=BYTES[:BYTES2]] [--print-bytes] [--quiet] [--silent]
[--verbose]
cmp [-v] [--help] [--version]
説明
cmp は 2 つのファイルを比較する。ファイルはどんな種類のものでもよく、比
較は 1 バイトずつ行われる。結果は標準出力に書き出される。 2 つのファ イ
ル名のうちの 1 つが ‘-’ にされた場合、 cmp はそのファイルの代わりに標準
入力を使う。
デフォルトでは、2 つのファイルの内容が同じ場合 cmp は何も出力しない。 2
つ のファイルの内容が異なる場合、最初に差異が生じたバイト位置と行番号を
表示する。バイト位置と行番号は 1 から始まる。
オプション
-b, --print-bytes
違いのあるバイトを表示する。制御文字は ‘^’ とそれに続く文字で 表
示し、ハイビットがセットされている (訳注: 0x80 から 0xFF までの)
バイトは (メタを示す) ‘M-’ を先頭につけて表示する。
-i BYTES[:BYTES2]], --ignore-initial=BYTES[:BYTES2]]
入力ファイルの最初の BYTES バイトまでにある違いを 無 視 す る 。
BYTES バイトより小さいサイズのファイルは空のファイルとして扱われ
る。 BYTES2 が指定された場合、比較する前に 2 つ目のファ イ ル の
BYTES2 バイトもスキップする。
-l, --verbose
違 いのある全てのバイトについて、オフセット行 (10 進数) とバイト
数 (8 進数) を表示する。
-n BYTES, --bytes=BYTES
BYTES バイト目までだけを比較する。
-s, --quiet, --silent
何も表示しない。 2 つのファイルが異なるかを示す終了状態のみを 返
す。
--help 使用法を標準出力に表示して終了する。
-v, --version
バージョン情報を標準出力に表示して終了する。
返り値
cmp は次のいずれかの状態を返して終了する:
0 2 つのファイルに違いはない。
1 2 つのファイルに違いがある。一方のファイルが他方のファイルより小
さく、 --verbose オプションが指定されている場合、 cmp は短い方の
ファイルの終端 EOF に達したことを表示する。
2 エラーが発生した。
関連項目
diff(1), diff3(1)
注意
プログラムのバグについては bug-gnu-utils@gnu.org へ報告してください。こ
のページは Ragnar Hojland Espinosa
CMP(1) User Commands CMP(1)
NAME
cmp - compare two files byte by byte
SYNOPSIS
cmp [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]
DESCRIPTION
Compare two files byte by byte.
-b --print-bytes
Print differing bytes.
-i SKIP --ignore-initial=SKIP
Skip the first SKIP bytes of input.
-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2
Skip the first SKIP1 bytes of FILE1 and the first SKIP2 bytes of
FILE2.
-l --verbose
Output byte numbers and values of all differing bytes.
-n LIMIT --bytes=LIMIT
Compare at most LIMIT bytes.
-s --quiet --silent
Output nothing; yield exit status only.
-v --version
Output version info.
--help Output this help.
SKIP1 and SKIP2 are the number of bytes to skip in each file. SKIP
values may be followed by the following multiplicative suffixes: kB
1000, K 1024, MB 1,000,000, M 1,048,576, GB 1,000,000,000, G
1,073,741,824, and so on for T, P, E, Z, Y.
If a FILE is ‘-’ or missing, read standard input.
AUTHOR
Written by Torbjorn Granlund and David MacKenzie.
REPORTING BUGS
Report bugs to
コロナウイルスの日ごとの感染者数・死者数をグラフ化してみました。どの国が増加傾向にあり、どの国が終息に向かっているかを視覚化しています。
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa