JOIN(1)
๐ join โ okay bestie, let's talk
so the manual name is join (it lives in section 1, user commands, in case anyone asks) and it does exactly one iconic thing: it takes lines from two files and glues them together when they share a common field. that's it. that's the whole vibe. โจ
๐ธ SYNOPSIS ๐ธ
join [OPTION]... FILE1 FILE2
๐ฆ DESCRIPTION ๐ฆ
okay so picture this: you've got two files, right? for every pair of input lines that have identical join fields, join writes a line out to standard output. and the default join field โ like, the one it uses if you don't say otherwise โ is the first field, and fields are delimited by blanks. easy. slay.
and here's a lil treat: if FILE1 or FILE2 (not both, bestie, pick one) is -, then it reads standard input. ๐ซถ
now. the options. there are a lot of them and honestly they're all kind of iconic, so let's go:
-a FILENUMโ also print the unpairable lines from file FILENUM, where FILENUM is1or2, matching up toFILE1orFILE2. so like, the leftovers get to come to the party too ๐-e STRINGโ replace missing (empty) input fields with STRING. i.e., the missing fields you specified with the'-12jo'options. no field left behind ๐-i,--ignore-caseโ ignore differences in case when comparing fields. uppercase, lowercase, we don't care, we're chill like that โจ-j FIELDโ literally just equivalent to'-1 FIELD -2 FIELD'. a shortcut, a little timesaver, we love her-o FORMATโ obey FORMAT while constructing the output line. you're in charge of the fit now ๐-t CHARโ use CHAR as the input and output field separator-v FILENUMโ like-a FILENUM, but suppress the joined output lines. only the loners, none of the couples ๐-1 FIELDโ join on this FIELD of file 1-2 FIELDโ join on this FIELD of file 2--check-orderโ check that the input is correctly sorted, even if all input lines are pairable. it's doing a vibe check on your sort fr fr--nocheck-orderโ do not check that the input is correctly sorted. live your truth, no vibe check today--headerโ treat the first line in each file as field headers, print them without trying to pair them. respect the headers, they're the main characters ๐-z,--zero-terminatedโ line delimiter isNUL, not newline--helpโ display this help and exit--versionโ output version information and exit
okay now the details, because this is where it gets real:
unless -t CHAR is given, leading blanks separate fields and are ignored. otherwise, fields are separated by CHAR. any FIELD is a field number counted from 1 (not 0, bestie, this isn't that kind of program).
FORMAT is one or more comma or blank separated specifications, and each one is either 'FILENUM.FIELD' or '0'. the default FORMAT outputs the join field, the remaining fields from FILE1, the remaining fields from FILE2, all separated by CHAR. and if FORMAT is the keyword 'auto', then the first line of each file determines the number of fields output for each line. cute, right? ๐
Important:FILE1andFILE2must be sorted on the join fields. this is not a suggestion, this is the law ๐ญ for example, use"sort -k 1b,1"ifjoinhas no options, or use"join -t ''"ifsorthas no options. comparisons honor the rules specified by'LC_COLLATE'. and if the input is not sorted and some lines cannot be joined, a warning message will be given. so like. sort your files. please. for me. ๐
๐ AUTHOR ๐
Written by Mike Haertel. legend behavior, honestly.
๐ญ REPORTING BUGS ๐ญ
found something cursed? tell the people:
- Report bugs to: <bug-coreutils@gnu.org>.
- Report any translation bugs to: <https://translationproject.org/team/>.
- GNU coreutils home page: <https://www.gnu.org/software/coreutils/>
- General help using GNU software: <https://www.gnu.org/gethelp/>
๐ COPYRIGHT ๐
Copyright ยฉ 2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. (ngl that part is important, don't skip it ๐ซถ)
๐ SEE ALSO ๐
comm(1)uniq(1)- Full documentation <https://www.gnu.org/software/coreutils/join> or available locally via:
info '(coreutils) join invocation'
and that's the whole page, bestie ๐ this was GNU coreutils 9.12, dated September 2026 โ go forth and join your lines, and remember: sort first, slay always. ๐ฆโจ
๐ฆ where this page comes from
- arch rolling: coreutils 9.12-2 ยท GPL-3.0-or-later AND GFDL-1.3-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms