Courseiva
Knowledge + Practice
CertificationsVendorsCareer RoadmapsLabs & ToolsStudy GuidesGlossaryPractice Questions
C
Courseiva

Free IT certification practice questions with explained answers for CCNA, CompTIA, AWS, Azure, Google Cloud, and more.

Certification Practice Questions

CCNA practice questionsSecurity+ SY0-701 practice questionsAWS SAA-C03 practice questionsAZ-104 practice questionsAZ-900 practice questionsCLF-C02 practice questionsA+ Core 1 practice questionsGoogle Cloud ACE practice questionsCySA+ CS0-003 practice questionsNetwork+ N10-009 practice questions
View all certifications →

Product

CertificationsCertification PathsExam TopicsPractice TestsExam Dumps vs Practice TestsStudy HubComparisons

Free Resources

Difficulty IndexLearn — Free ChaptersIT GlossaryFree Tools & LabsStudy GuidesCareer RoadmapsBrowse by VendorCisco Command ReferenceCCNA Scenarios

Company

AboutContactEditorial PolicyQuestion Writing PolicyTrust Center

Legal

Privacy PolicyTerms of Service

Courseiva is a free IT certification practice platform offering original exam-style practice questions, detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics for Cisco, CompTIA, Microsoft, AWS, and other technology certifications.

© 2026 Courseiva. Courseiva is operated by JTNetSolutions Ltd. All rights reserved.

Courseiva is an independent certification practice platform and is not affiliated with, endorsed by, or sponsored by Cisco, Microsoft, AWS, CompTIA, Google, ISC2, ISACA, or any other certification vendor. Vendor names and certification marks are used only to identify the exams learners are preparing for.

HomeCertificationsXK0-005TopicsScripting, Containers, and Automation
Free · No Signup RequiredCompTIA · XK0-005

XK0-005 Scripting, Containers, and Automation Practice Questions

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 Practice

Exam Domains

SecurityTroubleshootingScripting, Containers, and AutomationSystem ManagementScripting, Containers and AutomationAll domains →

Study Tools

Practice TestMock ExamFlashcardsAll Topics

Sample Scripting, Containers, and Automation Questions

Practice all 20+ →
1.

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.set -x
B.set -u
C.set -e
D.set -o pipefail

Explanation: The 'set -e' command causes the script to exit immediately when a command returns a non-zero exit status.

2.

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?

A.COPY config.txt /app/ and EXPOSE 8080
B.ADD config.txt /app/ and WORKDIR 8080
C.ADD config.txt /app/ and RUN expose 8080
D.COPY config.txt /app/ and CMD 8080

Explanation: COPY adds files from the build context, and EXPOSE documents the port. Other instructions serve different purposes.

3.

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.ls -l /var/log/*.log | awk '$5>100 {print $NF}'
B.for f in /var/log/*.log; do if [ -s $f -a $(stat -c%s $f) -gt 100 ]; then echo $f; fi; done
C.find /var/log -name '*.log' -size +100k -exec echo {} \;
D.for f in /var/log/*.log; do if [ $f -gt 100k ]; then echo $f; fi; done

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.

4.

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.systemd
B.service
C.command
D.shell

Explanation: The service module manages services (start, stop, restart, etc.). The other modules are for different purposes.

5.

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'?

A.docker start -i webapp
B.docker run -it webapp bash
C.docker exec -it webapp bash
D.docker attach 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 questions

How to master Scripting, Containers, and Automation for XK0-005

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

Frequently asked questions

How many XK0-005 Scripting, Containers, and Automation questions are on the real exam?

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.

Are these XK0-005 Scripting, Containers, and Automation practice questions free?

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.

Is Scripting, Containers, and Automation one of the harder XK0-005 topics?

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.

Ready to practice?

Launch a full Scripting, Containers, and Automation practice session with instant scoring and detailed explanations.

Start Scripting, Containers, and Automation Practice →

Topic Info

Topic

Scripting, Containers, and Automation

Exam

XK0-005

Questions available

20+