Bird
0
0

What will be the output of the command kubectl exec my-pod -- ls /tmp if the /tmp directory inside the Pod contains files file1.txt and file2.log?

medium📝 Command Output Q4 of 15
Kubernetes - Pods
What will be the output of the command kubectl exec my-pod -- ls /tmp if the /tmp directory inside the Pod contains files file1.txt and file2.log?
ANo such file or directory
BError: Pod not found
Cfile1.txt file2.log
DPermission denied
Step-by-Step Solution
Solution:
  1. Step 1: Understand the command effect

    The command lists files in the /tmp directory inside the Pod named my-pod.
  2. Step 2: Match output with directory contents

    Since /tmp contains file1.txt and file2.log, the output will list these filenames separated by space.
  3. Final Answer:

    file1.txt file2.log -> Option C
  4. Quick Check:

    ls output = listed files inside Pod directory [OK]
Quick Trick: kubectl exec runs command inside Pod, output shows command result [OK]
Common Mistakes:
  • Expecting error when files exist
  • Confusing Pod not found error
  • Assuming permission denied without cause

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes