Use the lsgroup command to display the
attributes of all the groups on the system (or of specified groups).
If one or more attributes cannot be read, the lsgroup command
lists as much information as possible.
The attribute information displays as Attribute=Value definitions,
each separated by a blank space.
- To list all of the groups on the system, type the following:
The system displays each group, group ID, and all of the
users in the group in a list similar to the following:
system 0 arne,pubs,ctw,geo,root,chucka,noer,su,dea,backup,build,janice,denise
staff 1 john,ryan,flynn,daveb,jzitt,glover,maple,ken,gordon,mbrady
bin 2 root,bin
sys 3 root,su,bin,sys
- To display specific attributes for all groups, do either
of the following:
- You can list attributes in the form
Attribute=Value
separated
by a blank space. This is the default style. For example, to list
the ID and users for all of the groups on the system, type the following:
lsgroup -a id users ALL | pg
A
list similar to the following is displayed: system id=0 users=arne,pubs,ctw,geo,root,chucka,noer,su,dea,backup,build
staff id=1 users=john,ryan,flynn,daveb,jzitt,glover,maple,ken
- You can also list the information in stanza format. For example,
to list the ID and users for all of the groups on the system in stanza
format, type the following:
lsgroup -a -f id users ALL | pg
A
list similar to the following is displayed: system:
id=0
users=pubs,ctw,geo,root,chucka,noer,su,dea,backup,build
staff:
id=1
users=john,ryan,flynn,daveb,jzitt,glover,maple,ken
bin:
id=2
users=root,bin
sys:
id=3
users=root,su,bin,sys
- To display all attributes for a specific group, you can
use one of two styles for listing specific attributes for all groups:
- You can list each attribute in the form
Attribute=Value
separated
by a blank space. This is the default style. For example, to list
all attributes for the group system, type the following: lsgroup system
A list similar to the
following is displayed: system id=0 users=arne,pubs,ctw,geo,root,chucka,noer,su,dea,backup,build,janice,denise
- You can also list the information in stanza format. For example,
to list all attributes for the group
bin
in stanza
format, type the following: lsgroup -f system
A
list similar to the following is displayed: system:
id=0 users=arne,pubs,ctw,geo,root,chucka,noer,su,dea,backup,build,janice,denise
- To list specific attributes for a specific group, type
the following:
lsgroup -a Attributes Group
For example, to list the ID and users for group
bin
,
type the following:
lsgroup -a id users bin
A
list similar to the following is displayed:
bin id=2 users=root,bin
See the lsgroup command
for the complete syntax.