join

Join lines from two files based on a join field

Usage: join options file1 file2

Standard Input: Used only if a file is given as a dash (–)

Standard Output: Used to display the results

SEE ALSO

For more information, see page 285

Useful options:

-aN means include all lines in file N.

-jN means use field N rather than 1 as the join field.

-jN M means use field M in file N as the join field.

-o A.B means display field B from file A.

-t means set the field separator to the following character.

Get Practical UNIX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.