Re: Getting the list of members in a group.



On Jun 20, 8:21 am, Davide Bianchi <davideyeahs...@xxxxxxxxxxxxxx>
wrote:
On 2007-06-20, Lew Pitcher <lpitc...@xxxxxxxxxxxx> wrote:

On Jun 20, 6:59 am, voipfc <voi...@xxxxxxxxxxxxxx> wrote:
The simplest way would be to
cat /etc/group
and look at the fourth field

All those have a problem: they don't give you all the members for a
group.

If I do this on my system:

# id
uid=1000(davide) gid=100(users)
groups=100(users),11(floppy),17(audio),18(video),19(cdrom)

# grep users /etc/group
users::100:

So I'm member of the group 'users' but I do not appear in the group file
associated to that group.

Actually, your results reflect a (common) problem with setup. It
appears that the "primary group" value from the various users recorded
in your /etc/password have not been carried over to your /etc/group
file.

If you are in this situation, then the process of obtaining a complete
listing for a group becomes a bit more complex. I don't think that
there is a specific tool that will answer your question in this case,
but a shell script could be crafted to do what you want.




.



Relevant Pages

  • Re: Getting the list of members in a group.
    ... How do you list the members of group from the command line? ... The simplest way would be to ... cat /etc/group ...
    (comp.os.linux.setup)
  • Re: set of a set etc.
    ... >>> Your cat is a member of the set of your cat. ... >> same members, and indivduals do not have members, all indivduals are ... Quine discusses other possible solutions. ... If for the sake of smooth systematization we see fit to assign ...
    (sci.math)
  • Re: Just joined - new member
    ... and also the genuine love and enthusiasm expressed by the ... members for their pets, ... yr. old cat from our local animal shelter about a year ago. ... This is not a Google Group that is just one ...
    (rec.pets.cats.anecdotes)
  • Re: Just joined - new member
    ... and also the genuine love and enthusiasm expressed by the ... members for their pets, ... yr. old cat from our local animal shelter about a year ago. ... but discovered she is a Maine Coon. ...
    (rec.pets.cats.anecdotes)
  • Re: Just joined - new member
    ... members for their pets, ... yr. old cat from our local animal shelter about a year ago. ... Tumbleweed is a perfect name for a Maine Coon. ...
    (rec.pets.cats.anecdotes)