Compare contents of two files
Tagged with: comm, command, compare, diff, file, Linux
Monday, June 23rd, 2008 10:03 PM
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