Courseiva

XK0-006 · topic practice

Automation, Orchestration, and Scripting practice questions

This domain covers Bash scripting, conditionals, quoting, and orchestration tooling on Linux. Questions test reading and writing shell logic, file tests, variable handling, and using kubectl to inspect Kubernetes workloads. You must recognize correct syntax and pick the right command for a given operational task.

Courseiva uses original exam-style practice questions designed for learning and revision. The goal is to understand the concepts, recognise exam patterns, and improve through explanations — not memorise copied exam dumps.

Editorial oversight:Johnson Ajibi· MSc IT Security, IEEE Senior Member
20 questionsDomain: Automation, Orchestration, and Scripting

What the exam tests

What to know about Automation, Orchestration, and Scripting

Write and debug Bash conditionals, quoting, and file tests, and run kubectl commands to inspect pods. The most important thing is matching the correct test operator and quoting style to the intended string or file check.

Bash test expressions with [ ], [[ ]], -f, -r, and string comparisons like -n and =

Single vs double quote behavior for variable expansion and literal strings

kubectl logs to retrieve stdout from a pod's main container

Shell control flow, exit codes, and command substitution in automation scripts

Watch out for

Common Automation, Orchestration, and Scripting exam traps

  • ▸Using = inside [[ ]] versus -eq for numeric tests, or forgetting spaces around [ and ]
  • ▸Assuming single quotes expand variables; they do not, so $NAME stays literal
  • ▸Running kubectl logs without -c when a pod has multiple containers, getting an error

Practice set

Automation, Orchestration, and Scripting questions

20 questions · select your answer, then reveal the explanation

An administrator is writing a bash script that loops through all .log files in /var/log and prints the file name if the file is larger than 100 kilobytes. Which loop correctly implements this?

A DevOps engineer wants to run a Docker container with a bind mount to make a host directory /data available at /mnt/data inside the container. Which command is correct?

A Podman user wants to run a container that automatically removes itself after it stops, runs in detached mode, and maps host port 80 to container port 8080. Which command is correct?

A system administrator is writing a bash script that must check if a file exists and is readable before processing. Which TWO test expressions can be used in an if statement? (Select TWO.)

A Kubernetes administrator is creating a deployment YAML manifest. Which THREE fields are required in a Deployment spec? (Select THREE.)

A developer is writing a Bash script that needs to test whether a file exists and is readable. Which of the following conditionals correctly performs this check?

A DevOps engineer is writing a Dockerfile. The application requires environment variables to be set at runtime from a file. Which Dockerfile instruction should be used to achieve this?

A Kubernetes YAML manifest defines a Deployment with 3 replicas. The administrator runs `kubectl get pods` and sees 3 running pods. They then run `kubectl scale deployment mydeployment --replicas=5`. What command would confirm the new number of replicas?

Which of the following Bash variable expansions will result in the string "Hello World"?

A Linux administrator is writing a Bash script that must accept command-line options for an input file (-i) and an output file (-o). Which of the following are valid methods to parse these options? (Choose TWO.)

A DevOps team is designing a containerized application using Docker Compose. They need to ensure that the database container is started before the application container. Which of the following Docker Compose directives can be used to control startup order? (Choose TWO.)

An administrator writes a bash script that uses a function to check if a file exists and is readable. The function returns 0 if the file meets the conditions, and 1 otherwise. Which of the following correctly implements this function?

Question 13mediummultiple choice
Study the full Python automation breakdown →

A system administrator needs to create a Dockerfile for a Python application. The application should be installed in the container, and when the container starts, it should run the command 'python app.py'. Which Dockerfile instruction should be used to specify the default command?

A Linux administrator is writing a bash script that needs to iterate over all files ending with .log in /var/log and output the number of lines in each file. Which loop construct should be used?

Question 15hardmultiple choice
Read the full Ansible explanation →

A DevOps team is using Ansible to manage configuration of web servers. They need to ensure that the Apache service is running and enabled at boot on all servers in the 'webservers' group. Which playbook task accomplishes this?

A containerized application uses a volume to persist data. The administrator needs to create a new volume named 'data-vol' and mount it to /app/data in the container. Which of the following commands accomplish this? (Select all that apply.)

An administrator needs to create a Docker network of type 'bridge' so that containers can communicate with each other by name. Which command creates a user-defined bridge network named 'my-net'?

A Linux administrator is writing a bash script to process a list of usernames stored in an array. The script must iterate over each username and print a welcome message. Which TWO of the following loops will correctly iterate over the array 'users' and print 'Welcome, <username>'? (Choose TWO.)

A DevOps engineer is writing a Bash script that iterates over all items in an array. The array is declared as 'fruits=("apple" "banana" "cherry")'. Which loop correctly iterates over each element?

An administrator is investigating a Bash script that is failing unexpectedly. They want to see each command as it is executed to debug the script. Which command should be added to the script?

Free account

Track your progress over time

Create a free account to save your results and see which topics improve across sessions.

Focused Automation, Orchestration, and Scripting sessions

Start a Automation, Orchestration, and Scripting only practice session

Every question in these sessions is drawn from the Automation, Orchestration, and Scripting domain — nothing else.

Related practice questions

Related XK0-006 topic practice pages

Move into related areas when this topic feels solid.

Frequently asked questions

What does the XK0-006 exam test about Automation, Orchestration, and Scripting?
Write and debug Bash conditionals, quoting, and file tests, and run kubectl commands to inspect pods. The most important thing is matching the correct test operator and quoting style to the intended string or file check.
How should I use these practice questions?
Select your answer before revealing the explanation. Then read why each option is right or wrong — this active recall approach builds retention far faster than re-reading notes.
Can I practise just Automation, Orchestration, and Scripting questions in a focused session?
Yes — the session launcher on this page draws every question from the Automation, Orchestration, and Scripting domain. Use a 10-question session first to gauge your baseline, then move to 20 or 30 once the weak spots are clear.
Where can I practise other XK0-006 topics?
Use the topic links above to move to related areas, or go back to the XK0-006 question bank to see all topics.
Are these real exam questions or dumps?
These are original practice questions written to test the same concepts the XK0-006 exam covers. They are not copied from any real exam or dump site.