cmdxray / commands / join

What does join do?

join the lines of two files that share a common field.

▸ Explain your own join command →

join examples, explained

$ join -t , -a 1 users.csv orders.csv

  • joinjoin the lines of two files that share a common field
  • -tuse this character as the input/output field separator
  • ,value for -t
  • -aalso print unpairable lines from file 1 or 2 (-a 1 / -a 2)
  • 1value for -a
  • users.csvan argument passed to the command
  • orders.csvan argument passed to the command

$ join file1 file2

  • joinjoin the lines of two files that share a common field
  • file1an argument passed to the command
  • file2an argument passed to the command

join flags & options

-1join on this field number from file 1
-2join on this field number from file 2
-tuse this character as the input/output field separator
-aalso print unpairable lines from file 1 or 2 (-a 1 / -a 2)
-vprint ONLY the unpairable lines from the given file
-ereplace empty output fields with this string
-ocontrol the output format (a list of fields)
-iignore case when comparing the join field

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.