
CompTIALinux+
Domain 4Objective 2
Shell Scripting XK0-006 Practice Questions (Page 1)
Part of the Automation, Orchestration, and Scripting domain, which accounts for 17% of the XK0-006 exam. CompTIA does not publish an official question count, but from its 90-minute exam (~35–60 total, ~6–10 in this domain), expect 1–2 from this objective — we provide 18 practice questions to prepare you well beyond it. (estimate)
18questions here
4free pages
10concepts
17%of the exam
Questions 1–5
- 1
What is the output of the following Bash script? ```bash myfunc() { echo "$2 $1" } myfunc alpha beta ```
Select an answer first - 2
A function `add` is defined as `add() { echo $(( $1 + $2 )); }`. The script calls `add 3 4`. What is the output?
Select an answer first - 3
Given the variable 'str="Hello World"', which command will output 'World'?
Select an answer first - 4
Which keyword is used to declare a variable with local scope inside a Bash function?
Select an answer first - 5
What is the purpose of defining a function in a shell script?
Select an answer first
Finished these 5 questions?
Review the revealed explanations, or continue through the curriculum.
Free Basic Practice is a study aid with revealable answers — not a scored exam. Examers.io is independent and not affiliated with or endorsed by CompTIA. “XK0-006” is a trademark of its owner, used for identification only.