Anthony Lucia
asked on
Linux, difference between configuration files
On Red Hat 6.x, I need a tool that will tell me the difference between 2 configuration files
Is there a tool that will do that
Also , is there a tool that will approach this in a more complex manner, and will NOT report all lines after the first mismatch, but will only report lines in the first file that are not contained in the second file ? For Instance:
a.conf
and b.conf
is there a tool that will report the difference as :
instead of
Thanks
Is there a tool that will do that
Also , is there a tool that will approach this in a more complex manner, and will NOT report all lines after the first mismatch, but will only report lines in the first file that are not contained in the second file ? For Instance:
a.conf
Line 1
Line 2
Line 3
line 4
line 5
line 6
and b.conf
Line 1
Line 2
line 4
line 5
line 6
is there a tool that will report the difference as :
Line 3
instead of
Line 3
line 4
line 5
line 6
Thanks
Try diff
diff a.conf b.conf
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The second tool you're looking for is "comm":
comm -2 -3 a.conf b.conf
comm creates 3 reports (in 3 columns):
1. Lines only in file 1
2 Lines only in file 2
3. Lines common to file 1 and file 2
The options "-1" "-2" and "-3" suppress displaying the respective column.