CompTIA Linux+ XK0-006 (V8) Practice Question

A Linux administrator is writing a Python 3 script that will run unattended on several distributions through cloud-init. The script must be able to (1) discover the absolute path of the interpreter that is executing it, (2) append the directory "/opt/tools" to the module search path so that import statements can find locally packaged utilities, and (3) terminate with exit status 2 if a validation step fails. Which single built-in Python module supplies attributes or functions to carry out all three of these tasks without adding any external dependencies?

  • os

  • sys

  • subprocess

  • platform

CompTIA Linux+ XK0-006 (V8)
Automation, Orchestration, and Scripting
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot