Linux "comm" Command Line Options and Examples
compare two sorted files line by line

Compare sorted files FILE1 and FILE2 line by line. When FILE1 or FILE2 (not both) is -, read standard input. With no options, produce three-column output.


Usage:

comm [OPTION]... FILE1 FILE2






Command Line Options:

-1
suppress column 1 (lines unique to FILE1)
comm -1 ...
-2
suppress column 2 (lines unique to FILE2)
comm -2 ...
-3
suppress column 3 (lines that appear in both files)
comm -3 ...
--check-order
check that the input is correctly sorted, even if all input lines are pairable
comm --check-order ...
--nocheck-order
do not check that the input is correctly sorted
comm --nocheck-order ...
--output-delimiter
separate columns with STR
comm --output-delimiter ...
--total
output a summary
comm --total ...
-z
line delimiter is NUL, not newline
comm -z ...
--help
display this help and exit
comm --help ...
--version
output version information and exitNote, comparisons honor the rules specified by 'LC_COLLATE'.EXAMPLEScomm -12 file1 file2Print only lines present in both file1 and file2.comm -3 file1 file2Print lines in file1 not in file2, and vice versa.AUTHORWritten by Richard M. Stallman and David MacKenzie.REPORTING BUGSGNU coreutils online help: <http://www.gnu.org/software/coreutils/>Report comm translation bugs to <http://translationproject.org/team/>COPYRIGHTCopyright © 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
comm --version ...