Adding many users to group on Linux

Sometime you need to add user to secondary group, then you put it in /etc/group file like:

...
users:x:554:user1,user2
...
# id user2
uid=502(user2) gid=502(user2) groups=502(user2),554(users)

There is a limit of string length in /etc/group file. I am not sure about the value of length limit, mine was about 740 characters on RedHat5. Then you cannot see added users belongs to group.

Then how to add many users to group? Just open new line with same beginning:

...
users:x:554:user1,user2
users:x:554:user33
...


Updated on Thu May 15 16:59:43 IDT 2014 More documentations here