Skip to content

Linux Operations Skills Quiz

This quiz tests your understanding of Linux operations skills used in Kubernetes environments.

Multiple Choice Questions

  1. Which command makes environment variables available to child processes?
    • A) set
    • B) export
    • C) declare
    • D) env
Show Answer

Answer: B) export

  1. When is .bashrc executed?
    • A) Only for login shells
    • B) For all shell sessions
    • C) For non-login interactive shells
    • D) Always with .bash_profile
Show Answer

Answer: C) For non-login interactive shells

  1. What does ${REPLICAS:-3} mean?
    • A) Set REPLICAS to 3
    • B) Use 3 if REPLICAS is not set
    • C) Subtract 3 from REPLICAS
    • D) Error
Show Answer

Answer: B) Use 3 if REPLICAS is not set

  1. What does awk 'NR>1 {print $1}' do?
    • A) Print first field of all lines
    • B) Print only the first line
    • C) Print first field excluding header
    • D) Print lines with first field
Show Answer

Answer: C) Print first field excluding header

  1. What is the role of g in sed -i 's/old/new/g'?
    • A) Case insensitive
    • B) Replace all matches in line
    • C) Replace once
    • D) Enable regex
Show Answer

Answer: B) Replace all matches in line

  1. What does -r do in jq -r?
    • A) Recursive search
    • B) Reverse order
    • C) Raw string output without quotes
    • D) Read-only
Show Answer

Answer: C) Raw string output without quotes

  1. What does ssh -L 8080:localhost:80 user@server mean?
    • A) Forward server 8080 to local 80
    • B) Forward local 8080 to server 80
    • C) Forward server 80 to local 8080
    • D) Forward local 80 to server 8080
Show Answer

Answer: B) Forward local 8080 to server 80

  1. What does wa represent in vmstat?
    • A) Web application CPU
    • B) I/O wait time percentage
    • C) Warning count
    • D) Active processes
Show Answer

Answer: B) I/O wait time percentage

  1. Which command creates an LVM Physical Volume?
    • A) lvcreate
    • B) vgcreate
    • C) pvcreate
    • D) fscreate
Show Answer

Answer: C) pvcreate

  1. What does curl -s -o /dev/null -w "%{http_code}" URL output?
    • A) Response body
    • B) Response headers
    • C) HTTP status code
    • D) Response time
Show Answer

Answer: C) HTTP status code

Short Answer Questions

  1. What command executes file contents in the current shell?
Show Answer

Answer: source (or .)

  1. What is the JSON parsing tool?
Show Answer

Answer: jq

  1. What SSH option is used for bastion jump?
Show Answer

Answer: ProxyJump (or -J)

  1. What command monitors disk I/O?
Show Answer

Answer: iostat

  1. What is the path to the Pod service account token?
Show Answer

Answer: /var/run/secrets/kubernetes.io/serviceaccount/token

Practical Questions

  1. Write a script with required DATABASE_URL and TIMEOUT default 30.
Show Answer
bash
#!/bin/bash
: ${DATABASE_URL:?"DATABASE_URL required"}
TIMEOUT=${TIMEOUT:-30}
  1. Write a command to output Pods with 3+ restarts as JSON.
Show Answer
bash
kubectl get pods -A -o json | jq '[.items[] | select([.status.containerStatuses[]?.restartCount] | add >= 3)]'
  1. Write an rsync command to sync yaml files through bastion.
Show Answer
bash
rsync -avzP --include='*.yaml' --exclude='*' -e "ssh -J bastion" /src/ user@host:/dest/

Advanced Questions

  1. Write a node diagnostic script.
Show Answer
bash
#!/bin/bash
echo "=== System ===" && uptime && free -h && df -h
echo "=== kubelet ===" && systemctl status kubelet --no-pager
  1. Explain ConfigMap env vars vs volume mount differences.
Show Answer
  • Environment Variables: Loaded at Pod start, requires restart for changes
  • Volume Mount: Auto-updates (~1 min), no restart needed

Return to Study Materials