- 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.