diff

UK['dɪf] US['dɪf]

abbr.differential differential (of);difference different;differ different;differentiator differentiator

Linux diff command syntax

Function:diff command is used to compare the differences of files.

Syntax:diff [-abBcdefHilnNpPqrstTuvwy][-][-C ][-D ][ -I ][-S ][-W ][-x ][-X ][ --help][--left-column][--suppress-common-line][file or directory 1][file or directory 2]

Linux diff command example

Compare two files

[root@localhost test3]# diff log2014.log log2013.log 3c3< 2014-03---> 2013-038c8< 2013-07---> 2013-0811,12d10< 2013-11< 2013-12

The above "3c3" and "8c8" indicate that the log2014.log and log20143log files have different contents in lines 3 and 8; "11,12d10" indicates the first The first file has more lines 11 and 12 than the second file.