Merge branch 'vendor/NCURSES'
[dragonfly.git] / usr.sbin / chown / chgrp.1
1 .\" Copyright (c) 1983, 1990, 1993, 1994
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" This code is derived from software contributed to Berkeley by
5 .\" the Institute of Electrical and Electronics Engineers, Inc.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\" 3. Neither the name of the University nor the names of its contributors
16 .\"    may be used to endorse or promote products derived from this software
17 .\"    without specific prior written permission.
18 .\"
19 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 .\" SUCH DAMAGE.
30 .\"
31 .\"     @(#)chgrp.1     8.3 (Berkeley) 3/31/94
32 .\" $FreeBSD: src/usr.sbin/chown/chgrp.1,v 1.9.2.3 2001/08/16 15:55:44 ru Exp $
33 .\" $DragonFly: src/usr.sbin/chown/chgrp.1,v 1.7 2006/02/17 19:40:13 swildner Exp $
34 .\"
35 .Dd March 31, 1994
36 .Dt CHGRP 1
37 .Os
38 .Sh NAME
39 .Nm chgrp
40 .Nd change group
41 .Sh SYNOPSIS
42 .Nm
43 .Op Fl fhvR
44 .Ar group
45 .Ar
46 .Nm
47 .Op Fl fv
48 .Oo
49 .Fl R
50 .Op Fl H | Fl L | Fl P
51 .Oc
52 .Ar group
53 .Ar
54 .Sh DESCRIPTION
55 The
56 .Nm
57 utility sets the group ID of the file named by each
58 .Ar file
59 operand to the
60 .Ar group
61 ID specified by the group operand.
62 .Pp
63 The following options are available:
64 .Bl -tag -width indent
65 .It Fl H
66 If the
67 .Fl R
68 option is specified, symbolic links on the command line are followed.
69 (Symbolic links encountered in the tree traversal are not followed).
70 .It Fl L
71 If the
72 .Fl R
73 option is specified, all symbolic links are followed.
74 .It Fl P
75 If the
76 .Fl R
77 option is specified, no symbolic links are followed.
78 This is the default.
79 .It Fl R
80 Recursively change file group IDs.
81 For each
82 .Ar file
83 operand that names a directory,
84 .Nm
85 shall change the group of the directory
86 and all files in the file hierarchy below it.
87 .It Fl f
88 The force option ignores errors, except for usage errors and doesn't
89 query about strange modes (unless the user does not have proper permissions).
90 .It Fl h
91 If the file is a symbolic link, the group ID of the link itself is changed
92 rather than the file that is pointed to.
93 .It Fl v
94 Cause
95 .Nm
96 to be verbose, showing files as the group is modified.
97 .El
98 .Pp
99 The
100 .Fl H ,
101 .Fl L
102 and
103 .Fl P
104 options are ignored unless the
105 .Fl R
106 option is specified.
107 In addition, these options override each other and the
108 command's actions are determined by the last one specified.
109 .Pp
110 The
111 .Ar group
112 operand can be either a group name from the group database,
113 or a numeric group ID.
114 If a group name is also a numeric group ID, the operand is used as a
115 group name.
116 .Pp
117 The user invoking
118 .Nm
119 must belong to the specified group and be the owner of the file,
120 or be the super-user.
121 .Sh FILES
122 .Bl -tag -width /etc/group -compact
123 .It Pa /etc/group
124 group ID file
125 .El
126 .Sh EXIT STATUS
127 .Ex -std
128 .Sh COMPATIBILITY
129 In previous versions of this system, symbolic links did not have groups.
130 .Pp
131 The
132 .Fl f
133 and
134 .Fl v
135 options are extensions to the standard.
136 .Sh SEE ALSO
137 .Xr chown 2 ,
138 .Xr fts 3 ,
139 .Xr group 5 ,
140 .Xr passwd 5 ,
141 .Xr symlink 7 ,
142 .Xr chown 8
143 .Sh STANDARDS
144 The
145 .Nm
146 utility conforms to
147 .St -p1003.2
148 and
149 .St -p1003.1-2004 .