Cloud & DevOps · Question 8 · Medium

Which command shows the last 20 lines of the file app.log?

  1. head -n 20 app.log
  2. cat -n 20 app.log
  3. grep -20 app.log
  4. 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

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