![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Synchronizing primary and secondary name servers | a2z1982 | UNIX for Dummies Questions & Answers | 4 | 11-01-2008 04:18 PM |
| primary-secondary sync problem | mbannout | UNIX for Advanced & Expert Users | 0 | 04-15-2008 06:52 AM |
| Change a users primary group after login | terrym | UNIX for Advanced & Expert Users | 3 | 02-09-2007 03:03 AM |
| Assigning existing users to a secondary group | jyotipg | UNIX for Dummies Questions & Answers | 1 | 05-15-2002 04:45 AM |
| How to find All Primary and Secondary Group ID's for a user | sanjay92 | UNIX for Dummies Questions & Answers | 2 | 03-27-2002 02:35 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
List ALL users in a Unix Group (Primary and Secondary)
Is there a command or better combination of cmds that will give me the list of Unix users in a particular Unix group whether their primary group is that group in question (information stored in /etc/passwd) or they are in a secondary group (information stored in /etc/group).
So far all I got is a combination of the following: groupName=XXXXX groupId=$( getent group | egrep "^${groupName}:" | cut -d: -f3 ) getent passwd | egrep "^.*:.*:.*:${groupId}" | cut -f1 -d: getent group | egrep "^${groupName}:" | cut -f4 -d: (Yeah for all you NIS and/or LDAP guys, I did use the getent commands) ![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|