comm
Compare two sorted files line by line to find unique and common lines. Use to identify differences and overlaps between datasets.
Instructions
Compare two sorted files line by line, returning column-tagged records (unique to file1, unique to file2, common). Read-only, no side effects. Requires pre-sorted input — use 'sort' first. Returns JSON with structured comparison results. Use to find differences and overlaps between datasets. Not for unsorted data — results are wrong without prior sorting. See also 'join', 'uniq', 'sort'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| raw | No | Write column-tab-line text without a JSON envelope. | |
| paths | Yes | Two files to compare. | |
| encoding | No | Text encoding (default: utf-8). Use 'auto' for BOM/autodetection. | utf-8 |
| max_lines | No | Maximum JSON records to emit. | |
| suppress_1 | No | Suppress records unique to the first file. | |
| suppress_2 | No | Suppress records unique to the second file. | |
| suppress_3 | No | Suppress records common to both files. | |
| show_encoding | No | Include encoding detection metadata in JSON result. | |
| encoding_errors | No | How to handle encoding errors (default: replace). | replace |
| encoding_profile | No | Locale-aware encoding fallback profile for auto-detection. |