terminal.cab
No.
22
Date
Learning goal
Terminal Start, lesson 10
Level
3 of 3

Command of the day No. 22: grep -E '^(ERROR|WARN)'

Purpose: Finds lines that start with ERROR or WARN.

Syntax: grep -E 'pattern' file

Example:

grep -E '^(ERROR|WARN)' logs/app.log
WARN disk 85% full
ERROR database timeout
WARN slow response
ERROR payment failed

Output from the simulator, as on a real Linux.

Options:

Try it in the terminal Share image

Fills in the command. Nothing runs until you press Enter.

Command of the day No. 22: grep -E '^(ERROR|WARN)'. Purpose: Finds lines that start with ERROR or WARN. Example: grep -E '^(ERROR|WARN)' logs/app.log. Remember: Single quotes keep | and ( ) away from the shell.
The same card as an image, 1080 x 1350 pixels.

Today's card ยท All cards so far