Relational Joins With the join Command

Combine two files on a shared key without a database.

LinuxtextclicsvLow risk
Run join -t, -1 1 -2 1 a.csv b.csv to merge rows with matching first fields.

01Command

Command
$ join -t, -1 1 -2 1 users.csv orders.csv

02What it does

join performs the work of a SQL inner join on sorted text files, streaming both inputs without loading a database. It is a shell-native data operation that makes CSV pipelines practical for analysts and admins.

03Risk

RiskLow risk
Requirementssudo apt install coreutils (join is part of coreutils)
!Warning: Both inputs must be sorted on the join field, or results are incomplete; sort them first.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-10-13 · Category: Developer

06Related solutions