20+ practice questions focused on Scripting, Containers, and Automation — one of the most tested topics on the CompTIA Linux+ XK0-005 exam. Each question includes a detailed explanation so you learn why the right answer is correct.
Start Scripting, Containers, and Automation PracticeA Linux administrator wants to ensure a bash script stops execution immediately if any command fails. Which line should be added to the script?
Explanation: The 'set -e' command causes the script to exit immediately when a command returns a non-zero exit status.
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?
Explanation: COPY adds files from the build context, and EXPOSE documents the port. Other instructions serve different purposes.
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?
Explanation: The find command with -size filters files larger than 100k, and -exec with {} runs the command for each file. The other options have syntax errors or incorrect logic.
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?
Explanation: The service module manages services (start, stop, restart, etc.). The other modules are for different purposes.
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'?
Explanation: docker exec -it runs an interactive command in a running container. The other commands are for different purposes.
+15 more Scripting, Containers, and Automation questions available
Practice all Scripting, Containers, and Automation questions1. Baseline your knowledge
Start with 10 questions to gauge your current understanding of Scripting, Containers, and Automation. This tells you whether you need a concept refresher or just practice.
2. Review every explanation
For each question — right or wrong — read the full explanation. Understanding why an answer is correct is more valuable than knowing the answer itself.
3. Focus on exam traps
Scripting, Containers, and Automation questions on the XK0-005 frequently use trap wording. Look for subtle differences in answers that test your precision, not just general knowledge.
4. Reach 80% consistently
Do repeated sessions until you score 80%+ three times in a row. Then move to mixed-mode practice to test cross-topic recall under realistic conditions.
The exact number varies per candidate. Scripting, Containers, and Automation is tested as part of the CompTIA Linux+ XK0-005 blueprint. Practicing with targeted Scripting, Containers, and Automation questions ensures you can handle any format or difficulty that appears.
Yes. Courseiva provides free XK0-005 practice questions across all exam topics and domains. The platform includes topic-based practice, mock exams, missed-question review, bookmarked questions, and readiness tracking — no account required.
Difficulty is subjective, but Scripting, Containers, and Automation is a high-priority exam concept tested in multiple ways — direct recall, scenario analysis, and command-output interpretation. Consistent practice is the best way to build confidence.
Launch a full Scripting, Containers, and Automation practice session with instant scoring and detailed explanations.
Start Scripting, Containers, and Automation Practice →