[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: group members



On Fri, Sep 21, 2007 at 04:56:33PM +0000, Mike -- EMAIL IGNORED wrote:
> On Thu, 20 Sep 2007 22:33:29 -0500, Mikkel L. Ellertson wrote:
> 
> > Mike -- EMAIL IGNORED wrote:
> >>>From a konsole, how can I determine
> >> all the members of a group?
> >> Thanks,
> >> Mike.
> >> 
> > One way is to rung something like "grep <group name> /etc/group". But
> > you can run into problems if the group name is also a user name, or is
> > part of a larger group name.
> > 
> > Mikkel
> [...]
> 
> How about:
>    grep ^<groupName>: /etc/group
> ?
> Mike.

That should work fine if your groups are all defined in /etc/group.  It
won't get you an answer if you're using NIS, LDAP, or some other naming
service.  The "getent" tool calls the same functions that applications
do, so it works no matter what the system's configured to use:
  getent group [groupname]

HTH,

Nalin


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]