COMM(1)

πŸ“¦
version 9.10 Β· 5 versions
, in ubuntu stonking

πŸ’– COMM(1) β€” the compare-two-sorted-files baddie πŸ’–

okay bestie, welcome to comm, section 1 of the manual (User Commands), part of the GNU coreutils girlies. this is the page for comparing two sorted files line by line and honestly? she's an icon. let's get into it πŸŽ€


✨ NAME ✨

comm β€” compare two sorted files line by line πŸ¦‹


✨ SYNOPSIS ✨

comm [OPTION]... FILE1 FILE2

✨ DESCRIPTION ✨

So the whole vibe is: you take FILE1 and FILE2, both sorted (this matters, we'll get there), and you compare them line by line. πŸ’…

When FILE1 or FILE2 β€” but not both β€” is -, she reads from standard input. only one of them tho, don't be greedy.

With no options, you get three-column output, and it's giving spreadsheet core:

  • column one = lines that are unique to FILE1
  • column two = lines that are unique to FILE2
  • column three = lines that are common to both files 🫢

Now the options, because there are options:

  • -1 β€” suppress column 1 (the lines unique to FILE1) πŸ™ˆ
  • -2 β€” suppress column 2 (the lines unique to FILE2) πŸ™ˆ
  • -3 β€” suppress column 3 (the lines that appear in both files) πŸ™ˆ
  • --check-order β€” check that the input is correctly sorted, even if all input lines are pairable. like, she's checking anyway, no shortcuts ✨
  • --nocheck-order β€” do not check that the input is correctly sorted. living dangerously, we respect it 😭
  • --output-delimiter=STR β€” separate the columns with STR πŸŽ€
  • --total β€” output a summary πŸ“Š
  • -z, --zero-terminated β€” line delimiter is NUL, not newline. for the null-separated girlies 🌈
  • --help β€” display this help and exit πŸ‘‘
  • --version β€” output version information and exit πŸ‘‘
comparisons honor the rules specified by 'LC_COLLATE'. so if your sorting looks weird, it's a locale thing, not you bestie πŸ’œ

✨ EXAMPLES ✨

the glow-ups, the moments, the slay ✨

comm -12 file1 file2

Print only lines present in both file1 and file2. ✨ twin moment ✨

comm -3 file1 file2

Print lines in file1 not in file2, and vice versa. the "we are not the same" edit πŸ’€


✨ AUTHOR ✨

Written by Richard M. Stallman and David MacKenzie. legends, fr fr. πŸ‘‘


✨ REPORTING BUGS ✨

found a bug? don't suffer in silence bestie, tell the coreutils girlies:


✨ SEE ALSO ✨

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


packaged by Ubuntu (9.10-1ubuntu2), 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. ⚠️ like, legally no promises, bestie πŸ’€

and that's the whole page!! GNU coreutils 9.10, August 2026 β€” COMM(1), no cap, that's the tea πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from