Bird
0
0

What will be the output of kubectl logs mypod --tail=5?

medium📝 Command Output Q4 of 15
Kubernetes - Pods
What will be the output of kubectl logs mypod --tail=5?
AShows the last 5 lines of logs from the pod 'mypod'
BShows the first 5 lines of logs from the pod 'mypod'
CShows all logs except the last 5 lines
DShows logs from all pods in the namespace
Step-by-Step Solution
Solution:
  1. Step 1: Understand the '--tail' option

    The --tail=5 option shows the last 5 lines of the pod logs.
  2. Step 2: Analyze other options

    It does not show the first 5 lines, exclude last 5 lines, or logs from all pods.
  3. Final Answer:

    Shows the last 5 lines of logs from the pod 'mypod' -> Option A
  4. Quick Check:

    --tail shows last lines of logs [OK]
Quick Trick: Use '--tail' to limit log lines shown [OK]
Common Mistakes:
  • Thinking --tail shows first lines
  • Expecting logs from all pods
  • Confusing tail with head

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes