nerdexam
CompTIA

XK0-005 · Question #688

A systems administrator wants to list all local account names and their respective UIDs. Which of the following commands will provide output containing this information?

The correct answer is C. cut -d: -f1,3 /etc/passwd. The /etc/passwd file contains user account information, where each line includes fields separated by colons. To list all user accounts and their UIDs, use cut -d: -f1,3 /etc/passwd. This cuts the first field (username) and the third field (UID) from each line.

System Management

Question

A systems administrator wants to list all local account names and their respective UIDs. Which of the following commands will provide output containing this information?

Options

  • Acut -c: -f3,1 /etc/passwd
  • Bcut -d: -s2,5 /etc/passwd
  • Ccut -d: -f1,3 /etc/passwd
  • Dcut -n: -f1,2 /etc/passwd

How the community answered

(18 responses)
  • A
    6% (1)
  • C
    89% (16)
  • D
    6% (1)

Explanation

The /etc/passwd file contains user account information, where each line includes fields separated by colons. To list all user accounts and their UIDs, use cut -d: -f1,3 /etc/passwd. This cuts the first field (username) and the third field (UID) from each line.

Topics

#Linux commands#File manipulation#/etc/passwd#User management

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice