grepstep 1 of 6
Search inside a file
grep prints every line in a file that contains what you’re looking for. Give it the word, then the file:
$ grep WARN logs/app.log WARN slow response from /search WARN disk 80% full
Most terminals highlight the matching part. grep is case-sensitive, so warn and WARN are different searches.
Your turn, in the terminal
- Find every line containing ERROR in logs/app.log