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.


comm [OPTION]... FILE1 FILE2

Command Line Options:

suppress column 1 (lines unique to FILE1)
comm -1 ...
suppress column 2 (lines unique to FILE2)
comm -2 ...
suppress column 3 (lines that appear in both files)
comm -3 ...
check that the input is correctly sorted, even if all input lines are pairable
comm --check-order ...
do not check that the input is correctly sorted
comm --nocheck-order ...
separate columns with STR
comm --output-delimiter ...
output a summary
comm --total ...
line delimiter is NUL, not newline
comm -z ...
display this help and exit
comm --help ...
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: <>Report comm translation bugs to <>COPYRIGHTCopyright © 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <>.This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
comm --version ...