xref: /freebsd/usr.sbin/chown/chgrp.1 (revision bfd34a4a6037d50f81f6ccc655d65b3f10840cd7)
1dea673e9SRodney W. Grimes.\" Copyright (c) 1983, 1990, 1993, 1994
2dea673e9SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
3dea673e9SRodney W. Grimes.\"
4dea673e9SRodney W. Grimes.\" This code is derived from software contributed to Berkeley by
5dea673e9SRodney W. Grimes.\" the Institute of Electrical and Electronics Engineers, Inc.
6dea673e9SRodney W. Grimes.\"
7dea673e9SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
8dea673e9SRodney W. Grimes.\" modification, are permitted provided that the following conditions
9dea673e9SRodney W. Grimes.\" are met:
10dea673e9SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
11dea673e9SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
12dea673e9SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
13dea673e9SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
14dea673e9SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
15dea673e9SRodney W. Grimes.\" 3. All advertising materials mentioning features or use of this software
16dea673e9SRodney W. Grimes.\"    must display the following acknowledgement:
17dea673e9SRodney W. Grimes.\"	This product includes software developed by the University of
18dea673e9SRodney W. Grimes.\"	California, Berkeley and its contributors.
19dea673e9SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors
20dea673e9SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
21dea673e9SRodney W. Grimes.\"    without specific prior written permission.
22dea673e9SRodney W. Grimes.\"
23dea673e9SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24dea673e9SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25dea673e9SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26dea673e9SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27dea673e9SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28dea673e9SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29dea673e9SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30dea673e9SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31dea673e9SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32dea673e9SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33dea673e9SRodney W. Grimes.\" SUCH DAMAGE.
34dea673e9SRodney W. Grimes.\"
35dea673e9SRodney W. Grimes.\"     @(#)chgrp.1	8.3 (Berkeley) 3/31/94
36dea673e9SRodney W. Grimes.\"
37dea673e9SRodney W. Grimes.Dd March 31, 1994
38dea673e9SRodney W. Grimes.Dt CHGRP 1
39dea673e9SRodney W. Grimes.Os BSD 4.2
40dea673e9SRodney W. Grimes.Sh NAME
41dea673e9SRodney W. Grimes.Nm chgrp
42dea673e9SRodney W. Grimes.Nd change group
43dea673e9SRodney W. Grimes.Sh SYNOPSIS
44dea673e9SRodney W. Grimes.Nm chgrp
45dea673e9SRodney W. Grimes.Oo
46dea673e9SRodney W. Grimes.Fl R
47dea673e9SRodney W. Grimes.Op Fl H | Fl L | Fl P
48dea673e9SRodney W. Grimes.Oc
49dea673e9SRodney W. Grimes.Op Fl f
50dea673e9SRodney W. Grimes.Ar group
51dea673e9SRodney W. Grimes.Ar files ...
52dea673e9SRodney W. Grimes.Sh DESCRIPTION
53dea673e9SRodney W. GrimesThe chgrp utility sets the group ID of the file named by each
54dea673e9SRodney W. Grimes.Ar file
55dea673e9SRodney W. Grimesoperand to the
56dea673e9SRodney W. Grimes.Ar group
57dea673e9SRodney W. GrimesID specified by the group operand.
58dea673e9SRodney W. Grimes.Pp
59dea673e9SRodney W. GrimesOptions:
60dea673e9SRodney W. Grimes.Bl -tag -width Ds
61dea673e9SRodney W. Grimes.It Fl H
62dea673e9SRodney W. GrimesIf the
63dea673e9SRodney W. Grimes.Fl R
64dea673e9SRodney W. Grimesoption is specified, symbolic links on the command line are followed.
65dea673e9SRodney W. Grimes(Symbolic links encountered in the tree traversal are not followed.)
66dea673e9SRodney W. Grimes.It Fl L
67dea673e9SRodney W. GrimesIf the
68dea673e9SRodney W. Grimes.Fl R
69dea673e9SRodney W. Grimesoption is specified, all symbolic links are followed.
70dea673e9SRodney W. Grimes.It Fl P
71dea673e9SRodney W. GrimesIf the
72dea673e9SRodney W. Grimes.Fl R
73dea673e9SRodney W. Grimesoption is specified, no symbolic links are followed.
74dea673e9SRodney W. Grimes.It Fl R
75dea673e9SRodney W. GrimesChange the group ID for the file hierarchies rooted
76dea673e9SRodney W. Grimesin the files instead of just the files themselves.
77dea673e9SRodney W. Grimes.It Fl f
78dea673e9SRodney W. GrimesThe force option ignores errors, except for usage errors and doesn't
79dea673e9SRodney W. Grimesquery about strange modes (unless the user does not have proper permissions).
80dea673e9SRodney W. Grimes.El
81dea673e9SRodney W. Grimes.Pp
82dea673e9SRodney W. GrimesSymbolic links don't have groups, so unless the
83dea673e9SRodney W. Grimes.Fl H
84dea673e9SRodney W. Grimesor
85dea673e9SRodney W. Grimes.Fl L
86dea673e9SRodney W. Grimesoption is set,
87dea673e9SRodney W. Grimes.Nm chgrp
88dea673e9SRodney W. Grimeson a symbolic link always succeeds and has no effect.
89dea673e9SRodney W. GrimesThe
90dea673e9SRodney W. Grimes.Fl H ,
91dea673e9SRodney W. Grimes.Fl L
92dea673e9SRodney W. Grimesand
93dea673e9SRodney W. Grimes.Fl P
94dea673e9SRodney W. Grimesoptions are ignored unless the
95dea673e9SRodney W. Grimes.Fl R
96dea673e9SRodney W. Grimesoption is specified.
97dea673e9SRodney W. GrimesIn addition, these options override each other and the
98dea673e9SRodney W. Grimescommand's actions are determined by the last one specified.
99dea673e9SRodney W. Grimes.Pp
100dea673e9SRodney W. GrimesThe
101dea673e9SRodney W. Grimes.Ar group
102dea673e9SRodney W. Grimesoperand can be either a group name from the group database,
103dea673e9SRodney W. Grimesor a numeric group ID.
104dea673e9SRodney W. GrimesIf a group name is also a numeric group ID, the operand is used as a
105dea673e9SRodney W. Grimesgroup name.
106dea673e9SRodney W. Grimes.Pp
107dea673e9SRodney W. GrimesThe user invoking
108dea673e9SRodney W. Grimes.Nm chgrp
109dea673e9SRodney W. Grimesmust belong to the specified group and be the owner of the file,
110dea673e9SRodney W. Grimesor be the super-user.
111dea673e9SRodney W. Grimes.Pp
112dea673e9SRodney W. GrimesThe
113dea673e9SRodney W. Grimes.Nm chgrp
114dea673e9SRodney W. Grimesutility exits 0 on success, and >0 if an error occurs.
115dea673e9SRodney W. Grimes.Sh COMPATIBILITY
116dea673e9SRodney W. GrimesPrevious versions of the
117dea673e9SRodney W. Grimes.Nm chgrp
118dea673e9SRodney W. Grimesutility changed the group of symbolic links specified on the command
119dea673e9SRodney W. Grimesline.
120dea673e9SRodney W. GrimesIn this system, symbolic links do not have groups.
121dea673e9SRodney W. Grimes.Sh FILES
122dea673e9SRodney W. Grimes.Bl -tag -width /etc/group -compact
123dea673e9SRodney W. Grimes.It Pa /etc/group
124dea673e9SRodney W. GrimesGroup ID file
125dea673e9SRodney W. Grimes.El
126dea673e9SRodney W. Grimes.Sh SEE ALSO
127dea673e9SRodney W. Grimes.Xr chown 2 ,
128bfd34a4aSWolfram Schneider.Xr fts 3 ,
129dea673e9SRodney W. Grimes.Xr group 5 ,
130dea673e9SRodney W. Grimes.Xr passwd 5 ,
131dea673e9SRodney W. Grimes.Xr symlink 7 ,
132dea673e9SRodney W. Grimes.Xr chown 8
133dea673e9SRodney W. Grimes.Sh STANDARDS
134dea673e9SRodney W. GrimesThe
135dea673e9SRodney W. Grimes.Nm chgrp
136dea673e9SRodney W. Grimesutility is expected to be POSIX 1003.2 compatible.
137