How to Compare Files Using diff Command in Linux

The “diff command” compares two files, returns the line(s) that are different, and tells you how to make the files the same.

Here’s an example to use ‘diff’ command

$ diff file1 file2

Here, File1 and File 2 are two files taken for comparison. The UNIX assigns for file 1 ‘A’ and for File 2 ‘B’. Then it gives clear differences.

Refer more for diff commands

Recent Posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.