Back to Blog
Arnošt Havelka

Bash Ripple Practice: Incident Combo

Run a two-step incident extraction and counting workflow with reproducible outputs.

Start Interactive Lesson
Bash Ripple Practice: Incident Combo

Bash Ripple Practice: Incident Combo

This capstone practice combines filtering, redirection, and counting under light pressure. You isolate warning lines first, then verify incident volume in a second command.

Commands to Practice

grep 'WARN' incidents.log > warn.txt
cat warn.txt | wc -l

Expected Terminal Signal

After extraction, warn.txt should contain only warning lines. Counting the file should return:

2

Why This Matters

Incident triage often needs a fast answer to two questions: "which lines matter?" and "how many are there?" This pattern answers both with minimal command overhead.

Common Mistakes

Practice Extension

Add a second filtered report:

grep 'ERROR' incidents.log > error.txt
cat error.txt | wc -l

By repeating the same pattern with different severities, you build a reusable triage toolkit.

References

These Microsoft Learn and Windows documentation links provide authoritative details for the commands used in this article.

Up Next

The Dir Command

Master the art of listing files.