Mission 50

Port text review

Read, sort, and count a training port list.

Text and logs
7 minutes Core Lesson 50 of 360
sortuniqwctail
Lesson 50 of 360 0/360 lessons 0/17 missions Text and logs · 7 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 7 minutes

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

Unique ports

Run cat data/ports.txt | sort | uniq.

cat data/ports.txt | sort | uniq
Count port lines

Run wc -l data/ports.txt.

wc -l data/ports.txt
Tail ports

Run tail -n 3 data/ports.txt.

tail -n 3 data/ports.txt
Lesson support

What to notice while you play.

Objective

Use simple text tools on a small list.

Hint

Compare sorted unique output with the line count.

Why it matters

Admin work often includes tiny text inventories.

Common mistakes
  • Assuming a list has no duplicates.
  • Counting before deduplicating when uniqueness matters.
Reference

Commands in this lesson.

wc [-l] <file>

Count lines, words, and characters.

sort|uniq

Practice simple text pipelines.