JOIN(1)
πΈ JOIN(1) β the manual page, but make it cute πΈ
okay bestie, settle in, because join from the User Commands section is genuinely one of the most underrated little tools in the whole toolbox and i need you to be obsessed with it π
β¨ NAME β¨
join β join lines of two files on a common field. that's it. that's the whole vibe. two files, one shared field, they get married. π
β¨ SYNOPSIS β¨
join [OPTION]... FILE1 FILE2
β¨ DESCRIPTION β¨
so here's the tea π: for every pair of input lines that have identical join fields, it writes a line to standard output. that's the whole friendship. the default join field is the first one, delimited by blanks.
and listen β when FILE1 or FILE2 is - (not both, bestie, one or the other, don't get greedy π), that file is read from standard input.
the options, one by one, no skipping π
-a FILENUMβ also print unpairable lines from file FILENUM, where FILENUM is1or2, corresponding to FILE1 or FILE2. like, don't ghost the lonely lines, okay?-e STRINGβ replace missing (empty) input fields with STRING. I.e., the missing fields you specified with the-12jooptions get filled in with your STRING instead of just... nothing.-i,--ignore-caseβ ignore differences in case when comparing fields. uppercase, lowercase, it's all love here π-j FIELDβ equivalent to-1 FIELD -2 FIELD. one flag, both files, so efficient, so iconic.-o FORMATβ obey FORMAT while constructing the output line.-t CHARβ use CHAR as the input and output field separator. changes everything about how fields are read, no cap.-v FILENUMβ like-a FILENUM, but suppress joined output lines. so you only see the unpaired ones. the solo era. periodt.-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 does not care that things happen to work out, it WILL check. π--nocheck-orderβ do not check that the input is correctly sorted. live your truth. (risky. but your call.)--headerβ treat the first line in each file as field headers, print them without trying to pair them. little VIP line, exempt from the whole matching situation.-z,--zero-terminatedβ line delimiter is NUL, not newline. for when newlines are simply not the moment.--helpβ display this help and exit. the classic.--versionβ output version information and exit.
the rules of the format game β¨
unless -t CHAR is given, leading blanks separate fields and are ignored. if -t CHAR is given, then fields are separated by CHAR, full stop.
any FIELD is a field number counted from 1.
FORMAT is one or more comma or blank separated specifications, each one being 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. brainy behavior honestly π§
IMPORTANT, like actually important: FILE1 and FILE2 must be sorted on the join fields.
e.g., use sort -k 1b,1 if join has no options, or use join -t '' if sort has 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... you'll know. you'll know.
β¨ AUTHOR β¨
Written by Mike Haertel. king behavior, we love him for it π
β¨ REPORTING BUGS β¨
found a bug? spill it π
- Report bugs to:
bug-coreutils@gnu.org - GNU coreutils home page:
https://www.gnu.org/software/coreutils/ - General help using GNU software:
https://www.gnu.org/gethelp/ - Report any translation bugs to:
https://translationproject.org/team/
β¨ SEE ALSO β¨
comm(1)uniq(1)- Full documentation:
https://www.gnu.org/software/coreutils/join - or available locally via:
info '(coreutils) join invocation'
Packaged by Ubuntu (9.10-1ubuntu2).
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.
and that's the whole page, bestie π«Ά this was GNU coreutils 9.10, from August 2026, and you just read JOIN(1). go sort your files, go join your lines, go be the main character of your own terminal π
πβ¨
π¦ where this page comes from
- ubuntu stonking: gnu-coreutils 9.10-1ubuntu2 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms