]> git.saurik.com Git - apple/file_cmds.git/blame - chown/chgrp.1
file_cmds-212.1.tar.gz
[apple/file_cmds.git] / chown / chgrp.1
CommitLineData
44a7a5ab
A
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. All advertising materials mentioning features or use of this software
16.\" must display the following acknowledgement:
17.\" This product includes software developed by the University of
18.\" California, Berkeley and its contributors.
19.\" 4. Neither the name of the University nor the names of its contributors
20.\" may be used to endorse or promote products derived from this software
21.\" without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
6c780a1f
A
35.\" @(#)chgrp.1 8.3 (Berkeley) 3/31/94
36.\" $FreeBSD: src/usr.sbin/chown/chgrp.1,v 1.13 2001/08/15 09:09:46 ru Exp $
44a7a5ab
A
37.\"
38.Dd March 31, 1994
39.Dt CHGRP 1
6c780a1f 40.Os
44a7a5ab
A
41.Sh NAME
42.Nm chgrp
43.Nd change group
44.Sh SYNOPSIS
864a4b6e 45.Nm chgrp
6c780a1f 46.Op Fl fhv
44a7a5ab
A
47.Oo
48.Fl R
49.Op Fl H | Fl L | Fl P
50.Oc
44a7a5ab 51.Ar group
6c780a1f 52.Ar
44a7a5ab
A
53.Sh DESCRIPTION
54The
864a4b6e 55.Nm chgrp
44a7a5ab
A
56utility sets the group ID of the file named by each
57.Ar file
58operand to the
59.Ar group
60ID specified by the group operand.
61.Pp
6c780a1f
A
62The following options are available:
63.Bl -tag -width indent
864a4b6e
A
64.It Fl f
65The force option ignores errors, except for usage errors and doesn't
66query about strange modes (unless the user does not have proper permissions).
44a7a5ab
A
67.It Fl H
68If the
69.Fl R
70option is specified, symbolic links on the command line are followed.
6c780a1f 71(Symbolic links encountered in the tree traversal are not followed).
864a4b6e
A
72.It Fl h
73If the file is a symbolic link, the group ID of the link itself is changed
74rather than the file that is pointed to.
44a7a5ab
A
75.It Fl L
76If the
77.Fl R
78option is specified, all symbolic links are followed.
79.It Fl P
80If the
81.Fl R
82option is specified, no symbolic links are followed.
40bf83fe
A
83This is the default. Use
84.Fl h
85to change the group ID of a symbolic link.
44a7a5ab
A
86.It Fl R
87Change the group ID for the file hierarchies rooted
88in the files instead of just the files themselves.
6c780a1f
A
89.It Fl v
90Cause
864a4b6e 91.Nm chgrp
6c780a1f 92to be verbose, showing files as the group is modified.
44a7a5ab
A
93.El
94.Pp
44a7a5ab
A
95The
96.Fl H ,
97.Fl L
98and
99.Fl P
100options are ignored unless the
101.Fl R
102option is specified.
103In addition, these options override each other and the
104command's actions are determined by the last one specified.
105.Pp
106The
107.Ar group
108operand can be either a group name from the group database,
109or a numeric group ID.
110If a group name is also a numeric group ID, the operand is used as a
111group name.
112.Pp
113The user invoking
864a4b6e 114.Nm chgrp
44a7a5ab
A
115must belong to the specified group and be the owner of the file,
116or be the super-user.
6c780a1f
A
117.Sh DIAGNOSTICS
118.Ex -std
119.Sh COMPATIBILITY
120In previous versions of this system, symbolic links did not have groups.
44a7a5ab
A
121.Pp
122The
6c780a1f
A
123.Fl v
124option is non-standard and its use in scripts is not recommended.
44a7a5ab
A
125.Sh FILES
126.Bl -tag -width /etc/group -compact
127.It Pa /etc/group
6c780a1f 128group ID file
44a7a5ab
A
129.El
130.Sh SEE ALSO
131.Xr chown 2 ,
44a7a5ab
A
132.Xr fts 3 ,
133.Xr group 5 ,
134.Xr passwd 5 ,
135.Xr symlink 7 ,
136.Xr chown 8
137.Sh STANDARDS
138The
864a4b6e 139.Nm chgrp
6c780a1f
A
140utility is expected to be
141.St -p1003.2
142compatible.