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
- 3
- 4
- 2
- 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
- In Kubernetes, what is a Pod?
- What is the difference between Continuous Delivery and Continuous Deployment?
- What does this shell pipeline print? Ignore any leading spaces.
- In a Dockerfile for a Node.js app, why are package.json and package-lock.json…
- Under the shared responsibility model for IaaS, who is responsible for…
- A developer uploads application code and the cloud provider runs it, managing…
- A bank keeps sensitive customer data in its own on-premises data centre but…
- Which Linux command prints the full path of the current working directory?
- What does Infrastructure as Code (IaC) mean?
- The ability of a cloud system to add resources automatically when demand rises…
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