Written 1 Sep 2026. This is a how-to, not a product card.
Compare sorted lists
After join, comm compares sorted lists so practice files show what is only in list 1, only in list 2, or in both. You don't need extra software for this.
Match files on a shared field matched files on a key. Tonight you compare two sorted lists: comm. Comm compares two sorted lists. Start with two tiny practice files already sorted, then comm ~/comm-a.txt ~/comm-b.txt. Comm prints three tab-separated columns. Column 1 is lines only in file 1. Column 2 is lines only in file 2. Column 3 is lines in both. 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 files matched on a shared field are what you want, that is match files on a shared field. If columns side by side without matching keys are what you want, that is join columns side by side. If files compared for edits are what you want, that is see whether two files are the same. Comm needs files already sorted. That sort is put lines in order.
What this is
comm compares sorted lists. You make two tiny practice files, already sorted, then type comm ~/comm-a.txt ~/comm-b.txt. Comm prints three tab-separated columns. Stick with that safe peek: a in column 1, d in column 2, b and c in column 3. Both files must already be sorted. If files are mixed order, comm can miss lines or warn. Put lines in order first: put lines in order. It is not join. Join matches files on a key into one line. It is not paste. Paste joins columns side by side. It is not diff. Diff compares files for edits.
Practice comm 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:
printf 'a\nb\nc\n' > ~/comm-a.txt
printf 'b\nc\nd\n' > ~/comm-b.txt
Compare sorted lists:
comm ~/comm-a.txt ~/comm-b.txt
You want three tab-separated columns. Column 1 is a. Column 2 is d. Column 3 is b then c. Then the prompt back. That is enough for tonight. Practice only in home.
Don't make sort the job. If files later need order, that is put lines in order.
Debian and Ubuntu usually already have comm. Don't make apt the job. If comm 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 ~/comm-a.txt ~/comm-b.txt
Useful extras, still home only
Optional: only lines in both:
comm -12 ~/comm-a.txt ~/comm-b.txt
Optional: only lines in file 1:
comm -13 ~/comm-a.txt ~/comm-b.txt
Optional: only lines in file 2:
comm -23 ~/comm-a.txt ~/comm-b.txt
-1 hides column 1, and so on. Don't make those required. You can stay on default print.
What this is not
This is not join. That is match files on a shared field. It is not cmp. That is see whether two files match byte for byte. It is not sort as the job. That is put lines in order. It is not uniq. That is drop duplicate lines. It is not paste. That is join columns side by side. It is not diff. That is see whether two files are the same. 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 files matched on a key? Match files on a shared field. Need byte-for-byte compare? See whether two files match byte for byte. 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. Tonight: two tiny practice files.
- Skip join, cmp, sort, uniq, paste, and diff as tonight's job. Those pages already exist.
- 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: comm(1). Ubuntu: comm(1). Official pages only. For the login, see SSH from the couch. For matching on a key, see match files on a shared field.