Relational Joins With the join Command
Combine two files on a shared key without a database.
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.csv02What 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
!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
- join.1.en.html manual page (Debian bookworm)Evidence: Documents join, which merges lines sharing a field, like a relational join.
Last verified: 2026-10-13 · Category: Developer