- No.
- 21
- Date
- Learning goal
- Terminal Start, lesson 10
- Level
- 2 of 3
Command of the day No. 21: grep -r
Purpose: Searches every file in a folder and below.
Syntax: grep -r word folder
Example:
grep -r ERROR logs
logs/app.log:ERROR database timeout
logs/app.log:INFO retry after ERROR ok
logs/app.log:ERROR payment failed
logs/old.log:ERROR disk full 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.