file compare
構文
file compare (files filename filename) <context | unified> <ignore-white-space>
説明
2つのローカルファイルを比較し、デフォルト、コンテキスト、または統一された出力スタイルでそれらの違いを説明します。
Default
- 出力の 1 行目で、 は 2 つのファイル間で行が変更されたことを意味し、d
2 つのファイル間で行が削除されたことを意味し、a
c
2 つのファイル間に行が追加されたことを意味します。このアルファベットマーカーの前の数字は最初のファイルを表し、アルファベットマーカーの後の行は2番目のファイルを表します。出力行の前にある左山括弧 (<
) は、最初のファイルを参照します。出力行の前にある右山括弧 (>
) は、2 番目のファイルを参照します。Context
- 表示は 2 つの部分に分かれています。最初の部分は最初のファイルです。2番目の部分は2番目のファイルです。感嘆符 (!
) で始まる出力行が変更されました。追加はプラス記号 ( 削除はマイナス記号 (+),
-)
.Unified
—表示の前には、1 番目と 2 番目のファイルの行番号(xx,,xxxx)が付きます。行番号の前に、ファイルへの追加はプラス記号 ( ファイルへの削除はマイナス記号 (+),
-)
.出力の本文には、影響を受ける行が含まれています。変更は、追加と削除と見なされます。
オプション
files filename | 比較する 2 つのローカル ファイルの名前。 |
context | (オプション)コンテキスト形式で出力を表示します。 |
ignore-white-space | (オプション)空白の量の変更を無視します。 |
unified | (オプション)統一された形式で出力を表示します。 |
必要な権限レベル
なし
出力フィールド
このコマンドを入力すると、リクエストステータスに関するフィードバックが提供されます。
サンプル出力
ファイル比較ファイル
user@host> file compare files /tmp/one /tmp/two 100c100 < full-name "File 1"; --- > full-name "File 2"; 102c102 < class foo; # 'foo' is not defined --- > class super-user;
ファイル比較ファイルのコンテキスト
user@host> file compare files /tmp/one /tmp/two context *** /tmp/one Wed Dec 3 17:12:50 2003 --- /tmp/two Wed Dec 3 09:13:14 2003 *************** *** 97,104 **** } } user bill { ! full-name "Bill Smith"; ! class foo; # 'foo' is not defined authentication { encrypted-password $ABC123; } --- 97,105 ---- } } user bill { ! full-name "Bill Smith"; ! uid 1089; ! class super-user; authentication { encrypted-password $ABC123; }
ファイル比較ファイルの統合
user@host> file compare files /tmp/one /tmp/two unified --- /tmp/one Wed Dec 3 17:12:50 2003 +++ /tmp/two Wed Dec 3 09:13:14 2003 @@ -97,8 +97,9 @@ } } user bill { - full-name "Bill Smith"; - class foo; # 'foo' is not defined + full-name "Bill Smith"; + uid 1089; + class super-user; authentication { encrypted-password $ABC123; }
ファイル比較ファイル 統一された空白を無視する
user@host> file compare files /tmp/one /tmp/two unified ignore-white-space --- /tmp/one Wed Dec 3 09:13:10 2003 +++ /tmp/two Wed Dec 3 09:13:14 2003 @@ -99,7 +99,7 @@ user bill { full-name "Bill Smith"; uid 1089; - class foo; # 'foo' is not defined + class super-user; authentication { encrypted-password $ABC123; # SECRET-DATA }
リリース情報
Junos OSリリース7.4より前に導入されたコマンド。