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