Cloud & DevOps · Question 12 · Hard
What does this shell pipeline print? Ignore any leading spaces.
printf "b\na\nb\nc\na\nb\n" | sort | uniq -c | sort -rn | head -1
- 2 a
- 3 b
- 1 c
- 3 a
Answer and explanation
Answer: B. 3 b
Explanation: sort groups identical lines, and uniq -c counts them: 2 a, 3 b, 1 c. sort -rn orders the counts in descending numeric order, and head -1 keeps the top line, "3 b".
Previous: What is the difference between Continuous Delivery and Continuous Deployment? · Next: The file server.log contains these four lines: ERROR disk full INFO ok ERROR…
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
- Adding two more identical application servers behind a load balancer to handle…
- In Kubernetes, what is a Pod?
- What is the difference between Continuous Delivery and Continuous Deployment?
- The file server.log contains these four lines: ERROR disk full INFO ok ERROR…
- 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?
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