cmdxray / commands / comm

What does comm do?

compare two SORTED files line by line, in three columns.

▸ Explain your own comm command →

comm examples, explained

$ comm a.txt b.txt

  • commcompare two SORTED files line by line, in three columns
  • a.txtan argument passed to the command
  • b.txtan argument passed to the command

$ comm -12 sorted1 sorted2

  • commcompare two SORTED files line by line, in three columns
  • -12a numeric option (often a count or limit)
  • sorted1an argument passed to the command
  • sorted2an argument passed to the command

$ comm -23 a b

  • commcompare two SORTED files line by line, in three columns
  • -23a numeric option (often a count or limit)
  • aan argument passed to the command
  • ban argument passed to the command

comm flags & options

-1suppress column 1 — lines unique to the first file
-2suppress column 2 — lines unique to the second file
-3suppress column 3 — lines common to both files
-icompare lines case-insensitively
--check-orderfail if either input is not properly sorted
--nocheck-orderdo not check that the input is sorted
--totalalso print a summary count line

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.