COMM(1)

๐Ÿ’– COMM(1) ๐Ÿ’–

okay bestie, so this is comm โ€” it lives in the User Commands section of your manual, and it's literally the group-chat moderator for two sorted files. ๐ŸŽ€


โœจ NAME โœจ

comm โ€” compare two sorted files line by line ๐Ÿฆ‹


๐ŸŒธ SYNOPSIS ๐ŸŒธ

comm [OPTION]... FILE1 FILE2

๐Ÿ’… DESCRIPTION ๐Ÿ’…

So here's the vibe: you give it FILE1 and FILE2, both sorted, and it compares them line by line. That's it, that's the whole personality. ๐Ÿ’œ

And when FILE1 or FILE2 is -? It reads standard input instead. Slay. ๐Ÿซถ

With no options at all, you get three-column output:

  • Column one โ€” lines unique to FILE1 ๐Ÿ‘‘
  • Column two โ€” lines unique to FILE2 โœจ
  • Column three โ€” lines common to both files ๐Ÿ’–

Now the options, bestie, listen up:

  • -1 โ€” suppress column 1 (lines unique to FILE1) ๐Ÿ™ˆ
  • -2 โ€” suppress column 2 (lines unique to FILE2) ๐Ÿ’€
  • -3 โ€” suppress column 3 (lines that appear in both files) ๐Ÿ˜ญ
  • --check-order โ€” check that the input is correctly sorted, even if all input lines are pairable
  • --nocheck-order โ€” do not check that the input is correctly sorted
  • --output-delimiter=STR โ€” separate columns with STR ๐ŸŒˆ
  • --total โ€” output a summary ๐Ÿงš
  • -z, --zero-terminated โ€” line delimiter is NUL, not newline โญ
  • --help โ€” display this help and exit
  • --version โ€” output version information and exit
and one more thing, no cap: comparisons honor the rules specified by 'LC_COLLATE'. ๐ŸŽ€

๐ŸŒˆ EXAMPLES ๐ŸŒˆ

comm -12 file1 file2  Print only lines present in both file1 and file2.
comm -3 file1 file2  Print lines in file1 not in file2, and vice versa.

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Written by Richard M. Stallman and David MacKenzie. iconic behavior honestly ๐Ÿซถ


๐Ÿ› REPORTING BUGS ๐Ÿ›

Report bugs to: <bug-coreutils@gnu.org>. Report any translation bugs to: <https://translationproject.org/team/>. GNU coreutils home page: <https://www.gnu.org/software/coreutils/> General help using GNU software: <https://www.gnu.org/gethelp/>


Copyright ยฉ 2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://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.


๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

join(1), uniq(1)

Full documentation <https://www.gnu.org/software/coreutils/comm> or available locally via: info '(coreutils) comm invocation'


okay that's the whole page, you ate that ๐Ÿ’… this was GNU coreutils 9.12, dated September 2026, and yes the footer says COMM(1) again because it loves being the main character ๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from