Cloud & DevOps · Question 13 · Hard

The file server.log contains these four lines: ERROR disk full INFO ok ERROR net ERROR retry error lowercase What does the command print?

grep -c "ERROR" server.log
  1. 3
  2. 4
  3. 2
  4. 1
Answer and explanation

Answer: C. 2

Explanation: grep -c counts matching lines, not occurrences, and the match is case-sensitive. Lines 1 and 3 contain "ERROR", so the output is 2.

Previous: What does this shell pipeline print? Ignore any leading spaces. · Next: In a Dockerfile for a Node.js app, why are package.json and package-lock.json…

Practise cloud & devops

Try a fresh set of cloud & devops questions with an explanation after every answer, free and without signing up: Cloud & DevOps practice. Or sit a full placement mock test.

More cloud & devops questions

More technical & programming practice

GenAI Basics · Pseudo-code · C Programming · Java · Python · Data Structures · Algorithms · Object-Oriented Programming

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge