O'Reilly logo

Ubuntu Unleashed 2014 Edition: Covering 13.10 and 14.04,Ninth Edition by Paul Hudson, Andrew Hudson, Matthew Helmke

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Finding Similarities in Files with comm

The comm command compares files line by line and outputs any lines that are identical. For example:

matthew@seymour:~$ comm file1 file2

This command output displays in three columns: column 1 shows lines only in file1, column2 shows every line only in file2, and column 3 shows every line that is the same between the two files. This is a much more detailed comparison than with diff, and the output can be overwhelming when all you want is to find or check for one or two simple changes. However, it can be incredibly useful when you aren’t terribly familiar with either file and want to see how they compare.

There are fewer options available when running comm. These three are the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required