May 2018
Beginner
332 pages
7h 28m
English
The comm command shows the lines unique to file_1 and file_2 along with the common lines in them. We can use various options while using the command in the scripts:
$ cat file_1
Barack Obama
David Cameron
Narendra Modi
$ cat file_2
Barack Obama
Angela Markel
Vladimir Putin
$ comm --nocheck-order file_1 file_2
Barack Obama
David Cameron
Engela Merkel
Narendra Modi
Vladimir Putin
In the preceding example, we can see the following:
The output shows that the unique lines in file_1 are David Cameron and Narendra Modi. The unique lines in the second file are Engela ...