Which command shows all supplementary groups for a user?

Prepare for the TestOut Labs Test. Interactive quizzes and flashcards with insights and tips for a comprehensive review. Ace your exam!

Multiple Choice

Which command shows all supplementary groups for a user?

Explanation:
To see what groups a user belongs to, use the groups command followed by the username. This prints the names of all groups that user is a member of, which includes the primary group and any supplementary groups they’ve been added to. So, running groups with the username shows all the groups for that user, directly answering the question about their supplementary memberships. For comparison, whoami only prints the current user’s name, id shows UID, GID, and all group memberships (giving more detail than just the list), and listing a directory has no relevance to group memberships.

To see what groups a user belongs to, use the groups command followed by the username. This prints the names of all groups that user is a member of, which includes the primary group and any supplementary groups they’ve been added to. So, running groups with the username shows all the groups for that user, directly answering the question about their supplementary memberships.

For comparison, whoami only prints the current user’s name, id shows UID, GID, and all group memberships (giving more detail than just the list), and listing a directory has no relevance to group memberships.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy