Skip to content
Clairos Learn

Text and logs · Lesson 32 of 38 · 8 minutes

Sorted account diff

Use comm to separate shared and unique account names.

Mastery 0/3Run itExplain itApply it
learner@clairosSimulated Linux lab
learner@clairos:~ $
↑ history · Tab complete · Ctrl+C cancel · Esc, Tab to leaveExit 0

Understand the pattern

Explaining differences between sorted text sets helps operators explain what they know before they change anything.

nl
Number input lines for a readable evidence reference.

Line numbers depend on the exact file version and numbering mode.

comm
Compare sorted line sets and select unique or common columns.

Both inputs must be sorted under the same ordering rules.

Worked example and expected result
$ nl data/users-a.txt
     1	admin
     2	learner
     3	www-data

Exit status: 0. The command completed successfully in the training fixture.

$ nl data/users-b.txt
     1	backup
     2	learner
     3	www-data

Exit status: 0. The command completed successfully in the training fixture.

$ comm data/users-a.txt data/users-b.txt
admin
	backup
		learner
		www-data

Exit status: 0. The command completed successfully in the training fixture.

Try a variation

Repeat this workflow in the sandbox with a different scratch filename. Keep the system fixtures unchanged and compare the observed output with your expectation before moving on.

Explain it

In “Sorted account diff”, which interpretation is safe?

Apply it elsewhere

Before adapting the nl workflow from “Sorted account diff” to another server, what should you do?

Keep the momentum.

Complete the lab, then explain and apply the pattern.

Next: Journal line numberingTry an incident drill

Anonymous lesson and mastery progress lasts for this session. Sign in to keep synced lesson XP between sessions; mastery stays device-local. No speed bonus, lost lives, or hint penalties.

Keep learning

  1. 01Numbered log readingAdd stable line numbers to a short authentication-log view.Practice
  2. 02Journal line numberingNumber a narrowed service journal so evidence is easy to reference.Practice
  3. 03Three-stage evidence pipelineSearch, number, and limit log evidence in one bounded pipeline.Practice