COMM(1)
π 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 isNUL, 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:
- Report bugs to:
bug-coreutils@gnu.org㪠- GNU coreutils home page:
<https://www.gnu.org/software/coreutils/> - General help using GNU software:
<https://www.gnu.org/gethelp/> - Report any translation bugs to
<https://translationproject.org/team/>π
β¨ 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. LicenseGPLv3+: 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 isNO 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
- ubuntu stonking: gnu-coreutils 9.10-1ubuntu2 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms