LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to view (primary) Group Members ? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-view-primary-group-members-4175535530/)

banagar 03-02-2015 08:44 AM

How to view (primary) Group Members ?
 
Dear Linux Gurus, how to view all group members?

my code snippet is like below:

groupadd yy
useradd -g yy u1
useradd -g yy u2
useradd -g yy u3

useradd -G yy u4


when i wanted to view the group members of group 'yy' in /etc/group, it only shows secondary group member i.e only u4. what is the problem? Why not showing other group members-u1,u2,u3?

I also used commands getent and groupmems, but they are showing only secondary group members i.e only u4 not others.

But when I used 'system-config-users', in group page, it shows all the users.

My doubt is how to view all the users belonging to group yy in terminal. which command to use?

Thanks in advance.
sorry for the grammatical mistakes.

Habitual 03-02-2015 09:02 AM

Welcome to LQ.
Have a look at http://www.cyberciti.biz/faq/linux-l...rs-of-a-group/


All times are GMT -5. The time now is 12:03 PM.