]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - usr.sbin/chown/chgrp.1
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.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 .\" 4. 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$
33 .\"
34 .Dd April 20, 2015
35 .Dt CHGRP 1
36 .Os
37 .Sh NAME
38 .Nm chgrp
39 .Nd change group
40 .Sh SYNOPSIS
41 .Nm
42 .Op Fl fhvx
43 .Oo
44 .Fl R
45 .Op Fl H | Fl L | Fl P
46 .Oc
47 .Ar group
48 .Ar
49 .Sh DESCRIPTION
50 The
51 .Nm
52 utility sets the group ID of the file named by each
53 .Ar file
54 operand to the
55 .Ar group
56 ID specified by the group operand.
57 .Pp
58 The following options are available:
59 .Bl -tag -width indent
60 .It Fl H
61 If the
62 .Fl R
63 option is specified, symbolic links on the command line are followed
64 and hence unaffected by the command.
65 (Symbolic links encountered during traversal are not followed.)
66 .It Fl L
67 If the
68 .Fl R
69 option is specified, all symbolic links are followed.
70 .It Fl P
71 If the
72 .Fl R
73 option is specified, no symbolic links are followed.
74 This is the default.
75 .It Fl R
76 Change the group ID of the file hierarchies rooted in the files,
77 instead of just the files themselves.
78 Beware of unintentionally matching the
79 .Dq Pa ".."
80 hard link to the parent directory when using wildcards like
81 .Dq Li ".*" .
82 .It Fl f
83 The force option ignores errors, except for usage errors and does not
84 query about strange modes (unless the user does not have proper permissions).
85 .It Fl h
86 If the file is a symbolic link, the group ID of the link itself is changed
87 rather than the file that is pointed to.
88 .It Fl v
89 Cause
90 .Nm
91 to be verbose, showing files as the group is modified.
92 If the
93 .Fl v
94 flag is specified more than once,
95 .Nm
96 will print the filename, followed by the old and new numeric group ID.
97 .It Fl x
98 File system mount points are not traversed.
99 .El
100 .Pp
101 The
102 .Fl H ,
103 .Fl L
104 and
105 .Fl P
106 options are ignored unless the
107 .Fl R
108 option is specified.
109 In addition, these options override each other and the
110 command's actions are determined by the last one specified.
111 .Pp
112 The
113 .Ar group
114 operand can be either a group name from the group database,
115 or a numeric group ID.
116 If a group name is also a numeric group ID, the operand is used as a
117 group name.
118 .Pp
119 The user invoking
120 .Nm
121 must belong to the specified group and be the owner of the file,
122 or be the super-user.
123 .Sh FILES
124 .Bl -tag -width /etc/group -compact
125 .It Pa /etc/group
126 group ID file
127 .El
128 .Sh EXIT STATUS
129 .Ex -std
130 .Sh COMPATIBILITY
131 In previous versions of this system, symbolic links did not have groups.
132 .Pp
133 The
134 .Fl v
135 and
136 .Fl x
137 options are non-standard and their use in scripts is not recommended.
138 .Sh SEE ALSO
139 .Xr chown 2 ,
140 .Xr fts 3 ,
141 .Xr group 5 ,
142 .Xr passwd 5 ,
143 .Xr symlink 7 ,
144 .Xr chown 8
145 .Sh STANDARDS
146 The
147 .Nm
148 utility is expected to be
149 .St -p1003.2
150 compatible.