coreutils: join invocation
1
1 8.3 ‘join’: Join lines on a common field
1 ========================================
1
1 ‘join’ writes to standard output a line for each pair of input lines
1 that have identical join fields. Synopsis:
1
1 join [OPTION]... FILE1 FILE2
1
1 Either FILE1 or FILE2 (but not both) can be ‘-’, meaning standard
1 input. FILE1 and FILE2 should be sorted on the join fields.
1
1 $ cat file1
1 a 1
1 b 2
1 e 5
1
1 $ cat file2
1 a X
1 e Y
1 f Z
1
1 $ join file1 file2
1 a 1 X
1 e 5 Y
1
1 ‘join’’s default behavior (when no options are given):
1 • the join field is the first field in each line;
1 • fields in the input are separated by one or more blanks, with
1 leading blanks on the line ignored;
1 • fields in the output are separated by a space;
1 • each output line consists of the join field, the remaining fields
1 from FILE1, then the remaining fields from FILE2.
1
Menu