Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

finding group of a user 2

Status
Not open for further replies.

philipose

Programmer
Dec 24, 2003
137
US
Unix gurus,
Is it possible for a non root user to find the groups another user belongs to? Any help will be helpful.

Regards
Philipose
 
pg /etc/group

or

id <username>

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
Code:
awk -F: '$0 ~ uname {print $1}' uname=<user name> /etc/group
will work on most, if not all, flavours of Unix. Note that it will list all groups, not just the primary group.

Ceci n'est pas une signature
Columb Healy
 
on AIX:

lsuser -a pgrp groups <username>


HTH,

p5wizard
 
For some reason columbs method did not work for me (AIX 5.2). Maybe I am doing something stupid. But the other approaches worked like a charm.
philipose
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top