nerdexam
ExamsXK0-004Questions#480
CompTIA

XK0-004 · Question #480

XK0-004 Question #480: Real Exam Question with Answer & Explanation

Sign in or unlock XK0-004 to reveal the answer and full explanation for question #480. The question stem and answer options stay visible for context.

Question

A Bash script is saving the following list of users from the home directory to a variable: User=''home/matt home/tom home/john home/mike''. Which of the following commands creates a list of only the usernames?

Options

  • AUsers='' (sed -r 's/home///g' <<< $Users)''
  • BUsers=$ (sed -r 's?|home/||'<<< $Users)
  • CUsers=$(Users//home\ /)
  • DUsers='sed -r 's/home\ ///g' <<< $users'

Unlock XK0-004 to see the answer

You've previewed enough free XK0-004 questions. Unlock XK0-004 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Full XK0-004 Practice