Courseiva

XK0-006 · topic practice

Automation, Orchestration, and Scripting practice questions

Practise CompTIA Linux+ (XK0-006) Automation, Orchestration, and Scripting practice questions — original exam-style scenarios with answer choices, explanations, and analysis of common mistakes.

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.

Reviewed byJohnson Ajibi· MSc IT Security
20 questionsDomain: Automation, Orchestration, and Scripting

What the exam tests

What to know about Automation, Orchestration, and Scripting

Automation, Orchestration, and Scripting questions test whether you can apply the concept in context, not just recognise a definition.

How the topic appears in realistic exam-style scenarios.

Which detail in the question changes the correct answer.

How to eliminate plausible but wrong options.

How to connect the question back to the wider exam objective.

Watch out for

Common Automation, Orchestration, and Scripting exam traps

  • Answering from memory before reading the full scenario.
  • Missing a constraint such as cost, availability, security, scope or command context.
  • Choosing a broad answer when the question asks for the most specific fix.
  • Ignoring why the wrong options are tempting.

Practice set

Automation, Orchestration, and Scripting questions

20 questions · select your answer, then reveal the explanation

An administrator is troubleshooting a Kubernetes deployment that is not receiving traffic. The deployment has one replica and the pod is running. The service is of type ClusterIP. Which command would help verify that the service endpoints are correctly associated with the pod?

Question 2mediummulti select
Read the full Ansible explanation →

An administrator is creating an Ansible playbook to configure multiple web servers. Which of the following are valid ways to define variables for different groups of hosts? (Choose TWO.)

A Bash script uses getopts to parse command-line options. The script is invoked as: ./script -a -b value. Which getopts string should be used to correctly parse -a (no argument) and -b (requires an argument)?

A Linux administrator wants to ensure a bash script stops execution immediately if any command fails. Which line should be added to the script?

A developer is writing a Dockerfile. The application requires a configuration file that should be copied from the build context and the container should expose port 8080. Which combination of Dockerfile instructions is correct?

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?

Question 7mediummultiple choice
Read the full Ansible explanation →

A team uses Ansible for configuration management. They want to ensure a service is running on all managed nodes. Which Ansible module should be used in the playbook?

A Docker container is running in the background. Which command allows the administrator to execute an interactive bash shell inside the running container named 'webapp'?

In a bash script, a developer needs to parse command-line options such as -f filename and -v (verbose). Which built-in command is best suited for this task?

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?

In bash, what is the difference between single quotes and double quotes?

An administrator needs to create a Docker image from a Dockerfile located in the current directory and tag it as 'myapp:v1'. Which command should be used?

In a bash script, a variable is set as follows: myvar='Hello World'. Which of the following correctly prints the first 5 characters of the variable?

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.)

Question 17mediummulti select
Read the full Ansible explanation →

An Ansible playbook is being written to manage web servers. Which TWO modules can be used to ensure a package is installed? (Select TWO.)

A Linux administrator writes a Bash script and includes the line `#!/bin/bash` at the top. What is the purpose of this line?

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 Linux administrator is troubleshooting a Bash script that unexpectedly terminates when a command fails. The script uses `#!/bin/bash`. Which of the following commands, if placed at the beginning of the script, would cause it to exit on any command failure?

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?
Automation, Orchestration, and Scripting questions test whether you can apply the concept in context, not just recognise a definition.
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.