1826372 Members
4988 Online
109692 Solutions
New Discussion

finding users group

 
TCEQ UNIX
Advisor

finding users group

Is there a command that I can run from command line to find primary and secondary groups of list of NIS users. "id username" displays all groups user belongs to but does not specify which one is primary group .

thanks
He who does not slow down at the sight of a police car is usually parked.
2 REPLIES 2
Patrick Wallek
Honored Contributor

Re: finding users group

When you run the 'id username' command the first group in the GID= list should the primary group as defined in /etc/passwd or your NIS database.
Hoefnix
Honored Contributor

Re: finding users group

using ypcat passwd will result in a list from your passwd file. The group id in the 4th field of each line is the users prim-group

Regards,

Peter