Menu
Coddy logo textTech

Filtering Errors

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

challenge icon

Challenge

Easy

Now let's filter the log to find only the error entries. Errors are critical issues that need attention, so being able to quickly extract them from a log file is an essential skill.

Use grep to display only the lines from server.log that contain ERROR.

grep "ERROR" server.log

Your output should show the three error entries from the log file.

Tip: The grep command is case-sensitive by default. Since our log uses uppercase ERROR, make sure to match that exactly. In the next lesson, you'll learn to count these filtered results.

Try it yourself

Terminal
head -n 5 server.log

All lessons in Fundamentals