Cloud & DevOps · Question 8 · Medium
Which command shows the last 20 lines of the file app.log?
- head -n 20 app.log
- cat -n 20 app.log
- grep -20 app.log
- tail -n 20 app.log
Answer and explanation
Answer: D. tail -n 20 app.log
Explanation: tail prints the end of a file, and -n 20 sets 20 lines. head prints the beginning of a file. tail -f is commonly used to follow a log live.
Previous: In Docker, what is the relationship between an image and a container? · Next: Adding two more identical application servers behind a load balancer to handle…
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 Continuous Integration (CI) mean in DevOps?
- After running chmod 754 report.sh, what are the permissions of report.sh?
- In Docker, what is the relationship between an image and a container?
- 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?
- What does this shell pipeline print? Ignore any leading spaces.
- 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…
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