Comparing files in Linux

We can use below commands to compare files in Linux.

  1. diff – Compare files line by line
  2. comm – Compare 2 sorted files line by line
  3. cmp – Compare 2 files byte by byte

diff command

“diff” command shows the difference between 2 files.

$ diff <file1Name> <file2Name>

You may also like...