🧀 Learn Linux

Master·Read and process text

comm: Compare sorted lists

Put in free practice

Syntax

comm [-123] File 1 File 2

Options

-1
hide first column
-2
hide second column
-3
Hide shared columns

Examples

comm -12 a.txt b.txt

Usage and sandbox support

The input must be sorted in alphabetical order; 1, 2, and 3 are unique, unique, and shared columns respectively.

Hands-on exercises

Full documentation ↗

Related commands