nerdexam
CompTIA

XK0-001 · Question #37

What is the quickest way to create a file that lists all the groups to which the user 'bob' belongs?

The correct answer is B. grep bob /etc/group > bob_groups.txt. See the full explanation below for the reasoning.

Question

What is the quickest way to create a file that lists all the groups to which the user 'bob' belongs?

Options

  • Awhereis bob >> bob_groups.txt
  • Bgrep bob /etc/group > bob_groups.txt
  • Cfind /etc/passwd bob >> /var/tmp/bob_groups.txt
  • Dcd /etc; cat groups | grep bob | vi > bob_groups.txt

How the community answered

(28 responses)
  • A
    4% (1)
  • B
    82% (23)
  • C
    11% (3)
  • D
    4% (1)

Community Discussion

No community discussion yet for this question.

Full XK0-001 Practice