xref: /minix3/sbin/chown/chgrp.1 (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1e39e890eSLionel Sambuc.\" Copyright (c) 1983, 1990, 1993, 1994, 2003
2e39e890eSLionel Sambuc.\"	The Regents of the University of California.  All rights reserved.
3e39e890eSLionel Sambuc.\"
4e39e890eSLionel Sambuc.\" This code is derived from software contributed to Berkeley by
5e39e890eSLionel Sambuc.\" the Institute of Electrical and Electronics Engineers, Inc.
6e39e890eSLionel Sambuc.\"
7e39e890eSLionel Sambuc.\" Redistribution and use in source and binary forms, with or without
8e39e890eSLionel Sambuc.\" modification, are permitted provided that the following conditions
9e39e890eSLionel Sambuc.\" are met:
10e39e890eSLionel Sambuc.\" 1. Redistributions of source code must retain the above copyright
11e39e890eSLionel Sambuc.\"    notice, this list of conditions and the following disclaimer.
12e39e890eSLionel Sambuc.\" 2. Redistributions in binary form must reproduce the above copyright
13e39e890eSLionel Sambuc.\"    notice, this list of conditions and the following disclaimer in the
14e39e890eSLionel Sambuc.\"    documentation and/or other materials provided with the distribution.
15e39e890eSLionel Sambuc.\" 3. Neither the name of the University nor the names of its contributors
16e39e890eSLionel Sambuc.\"    may be used to endorse or promote products derived from this software
17e39e890eSLionel Sambuc.\"    without specific prior written permission.
18e39e890eSLionel Sambuc.\"
19e39e890eSLionel Sambuc.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20e39e890eSLionel Sambuc.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21e39e890eSLionel Sambuc.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22e39e890eSLionel Sambuc.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23e39e890eSLionel Sambuc.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24e39e890eSLionel Sambuc.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25e39e890eSLionel Sambuc.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26e39e890eSLionel Sambuc.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27e39e890eSLionel Sambuc.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28e39e890eSLionel Sambuc.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29e39e890eSLionel Sambuc.\" SUCH DAMAGE.
30e39e890eSLionel Sambuc.\"
31e39e890eSLionel Sambuc.\"     from: @(#)chgrp.1	8.3 (Berkeley) 3/31/94
32*0a6a1f1dSLionel Sambuc.\"	$NetBSD: chgrp.1,v 1.6 2013/12/17 09:54:08 apb Exp $
33e39e890eSLionel Sambuc.\"
34e39e890eSLionel Sambuc.Dd October 22, 2012
35e39e890eSLionel Sambuc.Dt CHGRP 1
36e39e890eSLionel Sambuc.Os
37e39e890eSLionel Sambuc.Sh NAME
38e39e890eSLionel Sambuc.Nm chgrp
39e39e890eSLionel Sambuc.Nd change group
40e39e890eSLionel Sambuc.Sh SYNOPSIS
41e39e890eSLionel Sambuc.Nm
42e39e890eSLionel Sambuc.Oo
43e39e890eSLionel Sambuc.Fl R
44e39e890eSLionel Sambuc.Op Fl H | Fl L | Fl P
45e39e890eSLionel Sambuc.Oc
46e39e890eSLionel Sambuc.Op Fl fhv
47e39e890eSLionel Sambuc.Ar group
48e39e890eSLionel Sambuc.Ar
49e39e890eSLionel Sambuc.Nm
50e39e890eSLionel Sambuc.Oo
51e39e890eSLionel Sambuc.Fl R
52e39e890eSLionel Sambuc.Op Fl H | Fl L | Fl P
53e39e890eSLionel Sambuc.Oc
54e39e890eSLionel Sambuc.Op Fl fhv
55e39e890eSLionel Sambuc.Fl Fl reference=rfile
56e39e890eSLionel Sambuc.Ar
57e39e890eSLionel Sambuc.Sh DESCRIPTION
58e39e890eSLionel SambucThe
59e39e890eSLionel Sambuc.Nm
60e39e890eSLionel Sambucutility sets the group ID of the file named by each
61e39e890eSLionel Sambuc.Ar file
62e39e890eSLionel Sambucoperand to the
63e39e890eSLionel Sambuc.Ar group
64e39e890eSLionel SambucID specified by the group operand,
65e39e890eSLionel Sambucor to the group of the given
66e39e890eSLionel Sambuc.Ar rfile ,
67e39e890eSLionel Sambucspecified by the
68e39e890eSLionel Sambuc.Fl Fl reference
69e39e890eSLionel Sambucargument.
70e39e890eSLionel Sambuc.Pp
71e39e890eSLionel SambucOptions:
72e39e890eSLionel Sambuc.Bl -tag -width Ds
73e39e890eSLionel Sambuc.It Fl H
74e39e890eSLionel SambucIf the
75e39e890eSLionel Sambuc.Fl R
76e39e890eSLionel Sambucoption is specified, symbolic links on the command line are followed.
77e39e890eSLionel Sambuc(Symbolic links encountered in the tree traversal are not followed.)
78e39e890eSLionel Sambuc.It Fl L
79e39e890eSLionel SambucIf the
80e39e890eSLionel Sambuc.Fl R
81e39e890eSLionel Sambucoption is specified, all symbolic links are followed.
82e39e890eSLionel Sambuc.It Fl P
83e39e890eSLionel SambucIf the
84e39e890eSLionel Sambuc.Fl R
85e39e890eSLionel Sambucoption is specified, no symbolic links are followed.
86e39e890eSLionel Sambuc.It Fl R
87e39e890eSLionel SambucChange the group ID for the file hierarchies rooted
88e39e890eSLionel Sambucin the files instead of just the files themselves.
89e39e890eSLionel Sambuc.It Fl f
90e39e890eSLionel SambucThe force option ignores errors, except for usage errors and doesn't
91e39e890eSLionel Sambucquery about strange modes (unless the user does not have proper permissions).
92e39e890eSLionel Sambuc.It Fl h
93e39e890eSLionel SambucIf
94e39e890eSLionel Sambuc.Ar file
95e39e890eSLionel Sambucis a symbolic link, the group of the link is changed.
96e39e890eSLionel Sambuc.It Fl v
97e39e890eSLionel SambucCause
98e39e890eSLionel Sambuc.Nm
99e39e890eSLionel Sambucto be verbose, showing files as they are processed.
100e39e890eSLionel Sambuc.El
101e39e890eSLionel Sambuc.Pp
102e39e890eSLionel SambucIf
103e39e890eSLionel Sambuc.Fl h
104e39e890eSLionel Sambucis not given, unless the
105e39e890eSLionel Sambuc.Fl H
106e39e890eSLionel Sambucor
107e39e890eSLionel Sambuc.Fl L
108e39e890eSLionel Sambucoption is set,
109e39e890eSLionel Sambuc.Nm
110e39e890eSLionel Sambucon a symbolic link always succeeds and has no effect.
111e39e890eSLionel SambucThe
112e39e890eSLionel Sambuc.Fl H ,
113e39e890eSLionel Sambuc.Fl L
114e39e890eSLionel Sambucand
115e39e890eSLionel Sambuc.Fl P
116e39e890eSLionel Sambucoptions are ignored unless the
117e39e890eSLionel Sambuc.Fl R
118e39e890eSLionel Sambucoption is specified.
119e39e890eSLionel SambucIn addition, these options override each other and the
120e39e890eSLionel Sambuccommand's actions are determined by the last one specified.
121*0a6a1f1dSLionel SambucThe default is as if the
122*0a6a1f1dSLionel Sambuc.Fl P
123*0a6a1f1dSLionel Sambucoption had been specified.
124e39e890eSLionel Sambuc.Pp
125e39e890eSLionel SambucThe
126e39e890eSLionel Sambuc.Ar group
127e39e890eSLionel Sambucoperand can be either a group name from the group database,
128e39e890eSLionel Sambucor a numeric group ID.
129e39e890eSLionel SambucSince it is valid to have a group name that is numeric (and
130e39e890eSLionel Sambucdoesn't have the numeric ID that matches its name) the name lookup
131e39e890eSLionel Sambucis always done first.
132e39e890eSLionel SambucPreceding the ID with a ``#'' character will force it to be taken
133e39e890eSLionel Sambucas a number.
134e39e890eSLionel Sambuc.Pp
135e39e890eSLionel SambucThe user invoking
136e39e890eSLionel Sambuc.Nm
137e39e890eSLionel Sambucmust belong to the specified group and be the owner of the file,
138e39e890eSLionel Sambucor be the super-user.
139e39e890eSLionel Sambuc.Pp
140e39e890eSLionel SambucUnless invoked by the super-user,
141e39e890eSLionel Sambuc.Nm
142e39e890eSLionel Sambucclears the set-user-id and set-group-id bits on a file to prevent
143e39e890eSLionel Sambucaccidental or mischievous creation of set-user-id or set-group-id
144e39e890eSLionel Sambucprograms.
145e39e890eSLionel Sambuc.Pp
146e39e890eSLionel SambucThe
147e39e890eSLionel Sambuc.Nm
148e39e890eSLionel Sambucutility exits 0 on success, and \*[Gt]0 if an error occurs.
149e39e890eSLionel Sambuc.Sh FILES
150e39e890eSLionel Sambuc.Bl -tag -width /etc/group -compact
151e39e890eSLionel Sambuc.It Pa /etc/group
152e39e890eSLionel SambucGroup ID file
153e39e890eSLionel Sambuc.El
154e39e890eSLionel Sambuc.Sh SEE ALSO
155e39e890eSLionel Sambuc.Xr chown 2 ,
156e39e890eSLionel Sambuc.Xr lchown 2 ,
157e39e890eSLionel Sambuc.Xr fts 3 ,
158e39e890eSLionel Sambuc.Xr group 5 ,
159e39e890eSLionel Sambuc.Xr passwd 5 ,
160e39e890eSLionel Sambuc.Xr symlink 7 ,
161e39e890eSLionel Sambuc.Xr chown 8
162e39e890eSLionel Sambuc.Sh STANDARDS
163e39e890eSLionel SambucThe
164e39e890eSLionel Sambuc.Nm
165e39e890eSLionel Sambucutility is expected to be POSIX 1003.2 compatible.
166e39e890eSLionel Sambuc.Pp
167e39e890eSLionel SambucThe
168e39e890eSLionel Sambuc.Fl v
169e39e890eSLionel Sambucoption and the use of ``#'' to force a numeric group ID
170e39e890eSLionel Sambucare extensions to
171e39e890eSLionel Sambuc.St -p1003.2 .
172