Problem Statement
Which command combination finds and counts lines matching 'error' in a log file?
Explanation
The -c flag in grep counts matching lines instead of printing them.
This helps quickly check how many errors or warnings are present in a log file.
Code Solution
SolutionRead Only
grep -c error /var/log/syslog
Practice Sets
This question appears in the following practice sets: