O'Reilly logo

Advanced UNIX Programming by Warren W. Gay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Group Database

The previous section covered library functions that work with the password database. Functions that search the group database will be covered in this section.

The /etc/group File

The group database has traditionally been a simple text file /etc/group. Its format is similar to the password database, and a small example is as follows:

root::0:root
bin::1:root,bin,daemon
daemon::2:root,bin,daemon
sys::3:root,bin,adm
adm::4:root,adm,daemon,wwg
lp::7:lp
mem::8:
kmem::9:
mail::12:mail
news::13:news
uucp::14:uucp
man::15:man
users::100:student1,jan
postgres::102:wwg
nogroup::-1:
nobody::-1:

The format of the group database is illustrated in Table 12.5.

Table 12.5. The Group Database Fields
Field Example Description
1 users Group ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required