| JOIN ( 1 ) | USER COMMANDS | JOIN ( 1 ) |
|---|
The join field is a field in each file on which files are compared. By default join writes one line in the output for each pair of lines in files1 and files2 that have identical join fields. The default output line consists of the join field, then the remaining fields from file1, then the remaining fields from file2, but this can be changed with the -o option. The -a option can be used to add unmatched lines to the output. The -v option can be used to output only unmatched lines.
The files file1 and file2 must be ordered in the collating sequence of sort -b on the fields on which they are to be joined otherwise the results are unspecified.
If either file1 or file2 is -, join uses standard input starting at the current location.