Bird
0
0

Identify the error in this command: kubectl get pods -n

medium📝 Troubleshoot Q6 of 15
Kubernetes - kubectl Essential Commands
Identify the error in this command: kubectl get pods -n
AThe command should be 'kubectl list pods -n'
BPods resource is misspelled
CNamespace name is missing after -n flag
DThe -n flag is not valid for pods
Step-by-Step Solution
Solution:
  1. Step 1: Check the usage of -n flag

    The '-n' flag requires a namespace name immediately after it.
  2. Step 2: Identify missing argument

    The command ends with '-n' but no namespace is provided, causing an error.
  3. Final Answer:

    Namespace name is missing after -n flag -> Option C
  4. Quick Check:

    -n flag needs namespace name [OK]
Quick Trick: Always provide namespace name after -n [OK]
Common Mistakes:
  • Leaving out namespace name after -n
  • Using 'list' instead of 'get' command

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes