CompTIA

XK0-006 practice question 6

CompTIA Linux+ · free question 6 of 20

Question

An administrator needs to verify the user ID, home directory, and assigned shell for the user named "accounting." Which of the following commands should the administrator use to retrieve this information?
  • A. getent passwd accounting Correct
  • B. id accounting
  • C. grep accounting /etc/shadow
  • D. who accounting

Explanation

getent passwd accounting returns the user's passwd entry from the configured name services, which includes the UID, GID, home directory and login shell. id shows only the UID, GID and group memberships, /etc/shadow holds password hashes and aging data rather than the home directory or shell, and who lists logged-in users.

Practice the whole free set

Answer all 20 free XK0-006 questions with instant feedback, or unlock all 154 questions with Learn and Exam modes.