Cloud & DevOps · Question 22 · Medium
What does this shell pipeline print? Ignore any leading spaces.
printf "x\ny\nz\nx\ny\n" | sort -u | wc -l
- 3
- 5
- 2
- 1
Answer and explanation
Answer: A. 3
Explanation: The input has five lines: x, y, z, x, y. sort -u sorts them and keeps only unique lines (x, y, z), and wc -l counts 3 lines.
Previous: Which octal mode gives the permissions rw-r----- (owner read and write, group… · Next: A container is started with docker run -p 8080:80 nginx. What does the -p…
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
- What does Infrastructure as Code (IaC) mean?
- The ability of a cloud system to add resources automatically when demand rises…
- Which octal mode gives the permissions rw-r----- (owner read and write, group…
- A container is started with docker run -p 8080:80 nginx. What does the -p…
- What is blue-green deployment?
- A Kubernetes Deployment is configured with replicas: 3. One of its Pods…
- A service promises 99.9% availability per 30-day month. What is the maximum…
- A request must pass through a web server and then a database server, and both…
- When does a cron job with the schedule 30 2 * * 1 run?
- What does this shell pipeline print?
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