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

Command of the day No. 19: grep -n

Purpose: Finds lines and shows their line numbers.

Syntax: grep -n word file

Example:

grep -n WARN logs/app.log
3:WARN disk 85% full
7:WARN slow response

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. 19: grep -n. Purpose: Finds lines and shows their line numbers. Example: grep -n WARN logs/app.log. Remember: With -n you know exactly where to look.
The same card as an image, 1080 x 1350 pixels.

Today's card ยท All cards so far