file compare
Syntax
file compare (filesfilename filename)<context | unified> < ignore-white-space >Description
Compare local files and describe the differences between them in default, context, or unified output styles:
- Default—In the first line of output,
cmeans lines were changed between the two files,dmeans lines were deleted between the two files, andameans lines were added between the two files. The numbers preceding this alphabetical marker represent the first file, and the lines after the alphabetical marker represent the second file. A left angle bracket (<) in front of output lines refers to the first file. A right angle bracket (>) in front of output lines refers to the second file.- Context—Display is divided into two parts. The first part is the first file; the second part is the second file. Output lines preceded by an exclamation point (!) have changed. Additions are marked with a plus sign (
+),and deletions are marked with a minus sign (-).- Unified—Display is preceded by the line number from the first and the second file (
xx,x xx,x). Before the line number, additions to the file are marked with a plus sign (+),and deletions to the file are marked with a minus sign (-). The body of the output contains the affected lines. Changes are viewed as additions plus deletions.Options
context—(Optional) Context output format.
filename—Name of a local file to compare.
files—Precedes the first and second filenames.
ignore-white-space—(Optional) Ignore changes in amount of white space.
unified—(Optional) Unified style output format.Required Privilege Level
Sample Output:
File compare filesuser@host>file compare files /tmp/one /tmp/two100c100< full-name "File 1";---> full-name "File 2";102c102< class foo; # 'foo' is not defined---> class super-user;Sample Output: File compare files context
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 phil {! full-name "Phil Shafer";! class foo; # 'foo' is not definedauthentication {encrypted-password SECRET;}--- 97,105 ----}}user phil {! full-name "Phil Shafer";! uid 1089;! class super-user;authentication {encrypted-password SECRET;}Sample Output: File compare files unified
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 phil {- full-name "Phil Shafer";- class foo; # 'foo' is not defined+ full-name "Phil Shafer";+ uid 1089;+ class super-user;authentication {encrypted-passwordSECRET;}Sample Output:
File compare files unified ignore-white-spaceuser@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 phil {full-name "Phil Shafer";uid 1089;- class foo; # 'foo' is not defined+ class super-user;authentication {encrypted-password <SECRET>; # SECRET-DATA}