Show common and unique lines between two sorted files.

Section: Compare and Combine

Compare sorted line sets

bash
bash
comm file1.sorted file2.sorted

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Compare and Combine
Show unified diff
Compare two files in patch-friendly format.
OpenIn sheetbashsame section
Compare files byte-by-byte
Find first differing byte.
OpenIn sheetbashsame section
Concatenate multiple files
Combine files into one output file.
OpenIn sheetbashsame section
Print file content
Output a file to standard output.
Split file into chunks
Split a large file into 100 MB parts.