2 .\" Copyright 1989 AT&T Copyright (c) 1998 Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH GROUPADD 1M "Aug 27, 2008"
8 groupadd \- add (create) a new group definition on the system
12 \fB/usr/sbin/groupadd\fR [\fB-g\fR \fIgid\fR [\fB-o\fR]] \fIgroup\fR
18 The \fBgroupadd\fR command creates a new group definition on the system by
19 adding the appropriate entry to the \fB/etc/group\fR file.
23 The following options are supported:
27 \fB\fB-g\fR \fIgid\fR\fR
30 Assigns the group id \fIgid\fR for the new group. This group id must be a
31 non-negative decimal integer below \fBMAXUID\fR as defined in
32 \fB/usr/include/sys/param.h\fR. The group \fBID\fR defaults to the next
33 available (unique) number above the highest number currently assigned. For
34 example, if groups \fB100\fR, \fB105\fR, and \fB200\fR are assigned as
35 groups, the next default group number will be \fB201\fR. (Group \fBIDs\fR from
36 \fB0\fR\(mi\fB99\fR are reserved by SunOS for future applications.)
45 Allows the \fIgid\fR to be duplicated (non-unique).
51 The following operands are supported:
58 A string consisting of characters from the set of lower case alphabetic
59 characters and numeric characters. A warning message will be written if the
60 string exceeds \fBMAXGLEN,\fR which is usually set at eight characters. The
61 \fIgroup\fR field must contain at least one character; it accepts lower case or
62 numeric characters or a combination of both, and must not contain a colon
63 (\fB:\fR) or \fBNEWLINE.\fR
69 The following exit values are returned:
76 Successful completion.
85 Invalid command syntax. A usage message for the \fBgroupadd\fR command is
95 An invalid argument was provided to an option.
104 The \fIgid\fR is not unique (when \fB-o\fR option is not used).
113 The \fIgroup\fR is not unique.
122 The \fB/etc/group\fR file cannot be updated.
136 \fB/usr/include/userdefs.h\fR
141 \fBusers\fR(1B), \fBgroupdel\fR(1M), \fBgroupmod\fR(1M), \fBgrpck\fR(1M),
142 \fBlogins\fR(1M), \fBpwck\fR(1M), \fBuseradd\fR(1M), \fBuserdel\fR(1M),
143 \fBusermod\fR(1M), \fBgroup\fR(4), \fBattributes\fR(5)
147 \fBgroupadd\fR only adds a group definition to the local system. If a network
148 name service such as \fBNIS\fR or \fBNIS+\fR is being used to supplement the
149 local \fB/etc/group\fR file with additional entries, \fBgroupadd\fR cannot
150 change information supplied by the network name service. However,
151 \fBgroupadd\fR will verify the uniqueness of group name and group \fBID\fR
152 against the external name service.
155 If the number of characters in a \fBgroup\fR entry exceeds 2047, group
156 maintenance commands, such as \fBgroupdel\fR(1M) and \fBgroupmod\fR(1M), fail.