JOIN(1)

πŸ’– join(1) β€” the manual page, but make it a group chat πŸ’–

okay bestie so you're in the General Commands Manual and the command is join. and like. she's iconic. she takes two files and matches up lines that share the same join field, and then writes the matching pairs to standard output. the default join field? it's the first field, and it's delimited by blanks. no cap. ✨

and also, super important: if FILE1 or FILE2 β€” but not both, okay?? β€” is -, then she reads from standard input. 🫢


🌈 SYNOPSIS 🌈

join [OPTION]... FILE1 FILE2

πŸ’… DESCRIPTION πŸ’…

so here's the vibe fr fr: for every single pair of input lines that have identical join fields, she writes a line to standard output. that's it. that's the whole thing. πŸ‘‘

the default join field is the first one, and it's delimited by blanks.

and when FILE1 or FILE2 (again β€” not both, we don't do that here) is -, she reads standard input instead. 🌸


πŸŽ€ OPTIONS πŸŽ€

  • -a <FILENUM> β€” also print the unpairable lines from file FILENUM, where FILENUM is 1 or 2, matching up to FILE1 or FILE2 respectively. possible values are right here:
    • 1
    • 2
  • -v <FILENUM> β€” same energy as -a FILENUM, except she suppresses the joined output lines. so you only get the lonely ones. 😭 possible values:
    • 1
    • 2
  • -e <EMPTY> β€” replace any missing input fields with EMPTY. fill in the blanks, literally πŸ’œ
  • -i, --ignore-case β€” ignore differences in case when comparing fields. capital letters are NOT the drama here, bestie. ✨
  • -j <FIELD> β€” equivalent to -1 FIELD -2 FIELD. two-for-one deal, she ate that. πŸ”₯
  • -o <FORMAT> β€” obey FORMAT while constructing the output line. you pick the shape, she delivers. πŸŽ€
  • -t <CHAR> β€” use CHAR as both the input and output field separator. πŸ”₯
  • -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 literally every single input line is pairable. like, she's checking anyway, periodt.
  • --nocheck-order β€” do not check that the input is correctly sorted. not her business, not her problem. πŸ’€
  • --header β€” treat the first line in each file as field headers, and print them without trying to pair them. main character energy for the header row. πŸ‘‘
  • -z, --zero-terminated β€” line delimiter is NUL, not newline. feral, but valid. πŸ¦‹
  • -h, --help β€” print help
  • -V, --version β€” print version

⭐ VERSION ⭐

v(uutils coreutils) 0.12.0


🌸 EXAMPLES 🌸

join two files on the first (default) field:

join path/to/file1 path/to/file2

join two files using a comma (instead of a space) as the field separator:

join -t ',' path/to/file1 path/to/file2

join field3 of file1 with field1 of file2:

join -1 3 -2 1 path/to/file1 path/to/file2

produce a line for each unpairable line for file1:

join -a 1 path/to/file1 path/to/file2

join a file from stdin:

cat path/to/file1 | join - path/to/file2
okay so these examples are provided by the tldr-pages project <https://tldr.sh> under the CC BY 4.0 License. and heads up bestie: since uutils is a work in progress, some of these examples might fail. 😭 not her fault, she's still growing. 🌱

and that's the whole page!! 🫢 this one's dated 2026-09-25, and it's from uutils coreutils, version v(uutils coreutils) 0.12.0 β€” go match some fields, you're gonna slay πŸ’–βœ¨πŸ‘‘

πŸ“¦ where this page comes from