O'Reilly logo

Linux in a Nutshell, 6th Edition by Robert Love, Stephen Figgins, Ellen Siever, Arnold Robbins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

join

Synopsis

join [options] file1 file2

Join lines of two sorted files by matching on a common field. If either file1 or file2 is -, read from standard input. Often used to merge data stored in text-based file formats such as comma-separated-value formatted spreadsheets.

Options

−1 fieldnum1

The join field in file1 is fieldnum1. Default is the first field.

−2 fieldnum2

The join field in file2 is fieldnum2. Default is the first field.

-a filenum

Print a line for each unpairable line in file filenum, in addition to the normal output.

--check-order, --nocheck-order

Check or do not check that the files are correctly sorted on the join fields.

-e string

Replace missing input fields with string.

-i, --ignore-case

Ignore case differences when comparing fields.

-o fieldlist

Order the output fields according to fieldlist, where each entry in the list is in the form filenum.fieldnum. Entries are separated by commas or blanks.

-t char

Specifies the field-separator character (default is whitespace).

-v filenum

Print only unpairable lines from file filenum.

--help

Print help message and then exit.

--version

Print the version number and then exit.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required