1JOIN(1) User Commands JOIN(1)
2
3
4
6 join - join lines of two files on a common field
7
9 join [OPTION]... FILE1 FILE2
10
12 For each pair of input lines with identical join fields, write a line
13 to standard output. The default join field is the first, delimited by
14 whitespace. When FILE1 or FILE2 (not both) is -, read standard input.
15
16 -a FILENUM
17 also print unpairable lines from file FILENUM, where FILENUM is
18 1 or 2, corresponding to FILE1 or FILE2
19
20 -e EMPTY
21 replace missing input fields with EMPTY
22
23 -i, --ignore-case
24 ignore differences in case when comparing fields
25
26 -j FIELD
27 equivalent to '-1 FIELD -2 FIELD'
28
29 -o FORMAT
30 obey FORMAT while constructing output line
31
32 -t CHAR
33 use CHAR as input and output field separator
34
35 -v FILENUM
36 like -a FILENUM, but suppress joined output lines
37
38 -1 FIELD
39 join on this FIELD of file 1
40
41 -2 FIELD
42 join on this FIELD of file 2
43
44 --check-order
45 check that the input is correctly sorted, even if all input
46 lines are pairable
47
48 --nocheck-order
49 do not check that the input is correctly sorted
50
51 --header
52 treat the first line in each file as field headers, print them
53 without trying to pair them
54
55 -z, --zero-terminated
56 end lines with 0 byte, not newline
57
58 --help display this help and exit
59
60 --version
61 output version information and exit
62
63 Unless -t CHAR is given, leading blanks separate fields and are
64 ignored, else fields are separated by CHAR. Any FIELD is a field num‐
65 ber counted from 1. FORMAT is one or more comma or blank separated
66 specifications, each being 'FILENUM.FIELD' or '0'. Default FORMAT out‐
67 puts the join field, the remaining fields from FILE1, the remaining
68 fields from FILE2, all separated by CHAR. If FORMAT is the keyword
69 'auto', then the first line of each file determines the number of
70 fields output for each line.
71
72 Important: FILE1 and FILE2 must be sorted on the join fields. E.g.,
73 use "sort -k 1b,1" if 'join' has no options, or use "join -t ''" if
74 'sort' has no options. Note, comparisons honor the rules specified by
75 'LC_COLLATE'. If the input is not sorted and some lines cannot be
76 joined, a warning message will be given.
77
78 GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
79 Report join translation bugs to <http://translationproject.org/team/>
80
82 Written by Mike Haertel.
83
85 Copyright © 2013 Free Software Foundation, Inc. License GPLv3+: GNU
86 GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
87 This is free software: you are free to change and redistribute it.
88 There is NO WARRANTY, to the extent permitted by law.
89
91 comm(1), uniq(1)
92
93 The full documentation for join is maintained as a Texinfo manual. If
94 the info and join programs are properly installed at your site, the
95 command
96
97 info coreutils 'join invocation'
98
99 should give you access to the complete manual.
100
101
102
103GNU coreutils 8.22 October 2018 JOIN(1)