Written 1 Sep 2026. This is a how-to, not a product card.
Match files on a shared field
After column, match two practice files on a shared field with join so the lists line up on a key. You don't need extra software for this.
Line lists up in columns asked two short lines to sit in columns with printf and column -t. Tonight you match two lists on a shared field: join. Join means match two files on a shared field. Start with two tiny practice files already sorted on field 1, then join ~/join-a.txt ~/join-b.txt. Shared keys print. Unmatched keys stay out. Key 1 lives only in the first file. Key 4 lives only in the second. That is not join columns side by side. Paste joins columns without matching keys. You are still only practicing in home on the computer. It does not need extra system software, htop, Grafana, or a NAS for this one job.
Skip until SSH already works
SSH from the couch should already get you a prompt. If pretty columns are what you want, that is line lists up in columns. If columns side by side without matching keys are what you want, that is join columns side by side. If one column pulled is what you want, that is pull one column. Join needs files already sorted. That sort is put lines in order. If sorted lists compared are what you want, that is compare sorted lists.
What this is
join matches two files on a shared field. You make two tiny practice files, already sorted on field 1, then type join ~/join-a.txt ~/join-b.txt. Join looks at field 1 in both files. Whitespace splits fields. Shared keys print as 2 b x and 3 c y. Both files must already be sorted on the join field. Default field is 1. If files are mixed order, join can miss matches or warn. Put lines in order first: put lines in order. Tonight's practice files are already sorted. It is not paste, column, cut, uniq, comm, awk, SQL, or a spreadsheet app.
Practice join in home
SSH in. Make sure home is where you sit:
pwd
You want a path that ends in your login name. If not:
cd ~
Make two tiny practice files, already sorted on field 1:
printf '1 a\n2 b\n3 c\n' > ~/join-a.txt
printf '2 x\n3 y\n4 z\n' > ~/join-b.txt
Match on a shared field:
join ~/join-a.txt ~/join-b.txt
You want lines for shared keys 2 and 3 (2 b x then 3 c y), then the prompt back. Key 1 stays only in join-a.txt. Key 4 stays only in join-b.txt. That is enough for tonight. Practice only in home.
Don't make sort the job tonight. If files later need order, that is put lines in order.
Debian and Ubuntu usually already have join. Don't make apt the job. If join is missing:
sudo apt install coreutils
Then stop. That install is not the lesson.
When you are done, throw the practice files away. Careful delete only. That is delete a file carefully. Skip rm -rf.
rm -i ~/join-a.txt ~/join-b.txt
Useful extras, still home only
Optional: colon as the field split:
printf '1:a\n2:b\n3:c\n' > ~/join-a.txt
printf '2:x\n3:y\n4:z\n' > ~/join-b.txt
join -t : ~/join-a.txt ~/join-b.txt
That tells join to split fields on : instead of whitespace. You want 2:b:x then 3:c:y. You can stay on whitespace.
Optional: unmatched lines from file 1:
join -a 1 ~/join-a.txt ~/join-b.txt
That keeps unmatched keys from file 1 (key 1) plus matches. Don't make -a 1 required.
Optional: pick output fields:
join -o 1.1,1.2,2.2 ~/join-a.txt ~/join-b.txt
That picks field 1 from file 1, field 2 from file 1, field 2 from file 2. You can stay on default print.
Optional: join then head the first lines:
join ~/join-a.txt ~/join-b.txt | head -n 2
That shows only the first two matched lines. Head is not tonight's job.
Skip huge dumps. Join of whole home, /etc, password files, or huge logs is still a huge dump. Tonight: two tiny practice files.
Skip join piped into rm. Join matches files. Rm deletes them. Don't mix those jobs.
What this is not
This is not paste. Paste joins columns side by side without matching keys. That is join columns side by side. It is not column. That is line lists up in columns. It is not cut. That is pull one column. It is not sort as the job. Join needs files already sorted. That is put lines in order. It is not uniq. That is drop duplicate lines. It is not comm. That is compare sorted lists. It is not awk, SQL, or a spreadsheet. It is not echo as the job. Tonight uses printf only to make practice files. That is put a short line into a file. It is not opening SSH to the internet. That is keep the computer on the house network. Don't forward port 22.
What next
Need lists lined up in columns? Line lists up in columns. Need sorted lists compared? Compare sorted lists. Need columns side by side without matching keys? Join columns side by side. Need one column pulled out? Pull one column. Need files sorted first? Put lines in order. Need the practice files gone? Delete a file carefully. Keep SSH on the house network: keep the computer on the house network. Don't forward port 22.
Skip
- Skip if SSH still fails. Finish SSH from the couch first.
- Skip huge dumps as tonight's job. Tonight: two tiny practice files.
- Skip
joinpiped intorm. Join matches files. Don't mix delete into this drill. - Skip paste, column, cut, sort, uniq, and comm as tonight's job. Those pages already exist.
- Skip awk, SQL, and spreadsheet apps. Tonight:
joinon two tiny home files. - Skip files under
/etc, SSH folders, or paths you don't own. Practice only in home. - Skip
rm -rf. Careful delete only: delete a file carefully. - Skip opening SSH to the internet so you can do this from a coffee shop. That is keep the computer on the house network. Don't forward port 22.
Sources
Debian: join(1). Ubuntu: join(1). Official pages only. For the login, see SSH from the couch. For columns that line up, see line lists up in columns. For sorted lists compared, see compare sorted lists.