Mission 314

Sorted inventory comparison

Compare two sorted account inventories without modifying either file.

Files and paths
8 minutes Core Lesson 314 of 360
commcat
Lesson 314 of 360 0/360 lessons 0/17 missions Files and paths · 8 minutes
0%
Continue View profile
Ops lab terminal Training lab
New learnerrank 0XP 0%complete
learner@clairos:/home/learner $ Unix ops lab: type a command, press Enter
Instructions 8 minutes

Click any instruction for the command details, the why, and the common mistake to avoid.

Read the first inventory

Run cat data/users-a.txt.

cat data/users-a.txt
Read the second inventory

Run cat data/users-b.txt.

cat data/users-b.txt
Compare the inventories

Run comm data/users-a.txt data/users-b.txt.

comm data/users-a.txt data/users-b.txt
Lesson support

What to notice while you play.

Objective

Build repeatable confidence with comparing sorted inventories with comm.

Hint

Start with cat data/users-a.txt, inspect the result, then continue in order.

Why it matters

Comparing sorted inventories with comm helps operators explain what they know before they change anything.

Common mistakes
  • Skipping the output that proves comparing sorted inventories with comm.
  • Changing several things before recording a baseline.
Reference

Commands in this lesson.

cat <file>

Print text file contents.

comm <left> <right>

Compare two sorted text files line by line.