Compare contents of two files
Compare contents of two files by deleting only unique lines from ‘file1’
comm -1 file1 file2
Compare contents of two files by deleting only unique lines from ‘file1’
comm -1 file1 file2
The command cmp is similar to diff:
# cmp file1 file2
file1 file2 differ: byte 10, line 1
If you use the diff command, you will be able to see the difference between the files as shown below:
diff file1 file2
diff -y file1 file2 -W 120 #View side by side