CentOS Linux Server Guide

Checking content differences of two files in CentOS Linux

diff command is used to check for the differences in the content of two specified file

 

Command and Options:

diff  [options]  file1 file2

 

 

Option:

 
Options   Description
-i ignore case distinctions
-s report summary even if two files have no differences.

 

Examples:

 

The following example "fail" string in error.log. If matched, it will output all matched line to screen
diff file1 file2

4c4                            <------ Different in line 4

< James                      <------ The 4th line of file1

-------------

> james                       <------ The 4th line of file 2

 

 

Back to Managing Files and Folders in CentOS Linux

 



Copyright 2011 http://www.1a-centosserver.com All Rights Reserved

All trademarks are the property of their respective owners.

Contact Us | Terms of Use | Privacy Policy