Mission 49

Pipeline counts

Filter logs through safe text pipelines.

Text and logs
8 minutes Core Lesson 49 of 360
catgrepwcjournalctl
Lesson 49 of 360 0/360 lessons 0/17 missions Text and logs · 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.

Count denied lines

Run cat /var/log/auth.log | grep denied | wc -l.

cat /var/log/auth.log | grep denied | wc -l
Filter SSH journal

Run journalctl -u ssh | grep denied.

journalctl -u ssh | grep denied
Sort ports

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

cat /home/learner/data/ports.txt | sort | uniq
Lesson support

What to notice while you play.

Objective

Count filtered lines without leaving the simulator.

Hint

Pipe auth.log into grep denied, then wc -l.

Why it matters

Pipelines are a daily Unix skill for triage and reporting.

Common mistakes
  • Piping unsupported commands.
  • Forgetting the filter before the count.
Reference

Commands in this lesson.

cat <file>

Print text file contents.

grep [-i] <text> <file>

Find literal text inside a file.

wc [-l] <file>

Count lines, words, and characters.

journalctl -u <service>

Read simulated service journal entries.