Menu
Coddy logo textTech

Counting Occurrences

Part of the Fundamentals section of Coddy's Terminal journey — lesson 51 of 82.

challenge icon

Challenge

Easy

You've filtered the errors, but now you need to know exactly how many there are. Counting occurrences is essential for understanding the severity of issues in your logs.

Use a pipeline to count how many ERROR entries exist in server.log. Combine grep with wc -l to get the count.

grep "ERROR" server.log | wc -l

Your output should be a single number representing the total count of error entries.

Tip: The wc -l command counts lines. When piped after grep, it counts how many lines matched your search pattern. In the final lesson, you'll save these findings to a report file.

Try it yourself

Terminal
grep "ERROR" server.log

All lessons in Fundamentals