Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

LPI Exam 102-500 Topic 2 Question 107 Discussion

Actual exam question for LPI's 102-500 exam
Question #: 107
Topic #: 2
[All 102-500 Questions]

What command will display the group names and GIDs to which a user belongs? (Provide only the command name with or without path information)

Show Suggested Answer Hide Answer
Suggested Answer: A

Theidcommand will display the user ID (uid), the primary group ID (gid), and the supplementary groups (groups) of a user. The output will show the names and the numerical IDs of the groups. For example:

id linuxize

The command will show the user ID (uid), the user's primary group (gid), and the user's secondary groups (groups)

uid=1001(linuxize) gid=1001(linuxize) groups=1001(linuxize),27(sudo)

To print only the names instead of the numbers use the-noption.

id -nG linuxize

The command will show only the names of the groups

linuxize sudo

Theidcommand is part of the GNU coreutils package and is available on all Linux systems. The full path of the command is/usr/bin/id.Reference:

id(1) - Linux manual page

How to List Groups in Linux | Linuxize


Contribute your Thoughts:

Jeannetta
4 hours ago
id
upvoted 0 times
...
Albert
3 days ago
id
upvoted 0 times
...
Coral
12 days ago
I think the correct answer is `id`. It's a simple and straightforward command to display user group information.
upvoted 0 times
...
Kris
12 days ago
id
upvoted 0 times
...
Hershel
15 days ago
id
upvoted 0 times
...

Save Cancel