document U= mailer field
[unix-history] / usr / src / usr.sbin / chown / chgrp.1
CommitLineData
c6bbda50 1.\" Copyright (c) 1983, 1990, 1993, 1994
4459015a 2.\" The Regents of the University of California. All rights reserved.
33e3bdbe 3.\"
cf136d2c
KB
4.\" This code is derived from software contributed to Berkeley by
5.\" the Institute of Electrical and Electronics Engineers, Inc.
6.\"
b5dc1377 7.\" %sccs.include.redist.man%
33e3bdbe 8.\"
8fbabe2e 9.\" @(#)chgrp.1 8.3 (Berkeley) %G%
b5dc1377
CL
10.\"
11.Dd
12.Dt CHGRP 1
13.Os BSD 4.2
14.Sh NAME
15.Nm chgrp
16.Nd change group
17.Sh SYNOPSIS
18.Nm chgrp
c6bbda50
KB
19.Oo
20.Fl R
21.Op Fl H | Fl L | Fl P
22.Oc
23.Op Fl f
b5dc1377
CL
24.Ar group
25.Ar files ...
26.Sh DESCRIPTION
27The chgrp utility sets the group ID of the file named by each
28.Ar file
29operand to the
30.Ar group
31ID specified by the group operand.
32.Pp
33Options:
0e853b88 34.Bl -tag -width Ds
e4eb33c7 35.It Fl H
c6bbda50
KB
36If the
37.Fl R
38option is specified, symbolic links on the command line are followed.
39(Symbolic links encountered in the tree traversal are not followed.)
40.It Fl L
41If the
42.Fl R
43option is specified, all symbolic links are followed.
44.It Fl P
45If the
46.Fl R
47option is specified, no symbolic links are followed.
0e853b88 48.It Fl R
c6bbda50
KB
49Change the group ID for the file hierarchies rooted
50in the files instead of just the files themselves.
0e853b88 51.It Fl f
b5dc1377 52The force option ignores errors, except for usage errors and doesn't
76229015 53query about strange modes (unless the user does not have proper permissions).
0e853b88 54.El
b5dc1377 55.Pp
c6bbda50 56Symbolic links don't have groups, so unless the
e4eb33c7 57.Fl H
c6bbda50
KB
58or
59.Fl L
60option is set,
e4eb33c7 61.Nm chgrp
8fbabe2e 62on a symbolic link always succeeds and has no effect.
c6bbda50
KB
63The
64.Fl H ,
65.Fl L
66and
67.Fl P
68options are ignored unless the
69.Fl R
70option is specified.
71In addition, these options override each other and the
72command's actions are determined by the last one specified.
e4eb33c7 73.Pp
b5dc1377
CL
74The
75.Ar group
c6bbda50
KB
76operand can be either a group name from the group database,
77or a numeric group ID.
78If a group name is also a numeric group ID, the operand is used as a
79group name.
b5dc1377
CL
80.Pp
81The user invoking
c6bbda50
KB
82.Nm chgrp
83must belong to the specified group and be the owner of the file,
84or be the super-user.
b5dc1377
CL
85.Pp
86The
87.Nm chgrp
88utility exits 0 on success, and >0 if an error occurs.
c6bbda50
KB
89.Sh COMPATIBILITY
90Previous versions of the
91.Nm chgrp
92utility changed the group of symbolic links specified on the command
93line.
94In this system, symbolic links do not have groups.
b5dc1377 95.Sh FILES
0e853b88
CL
96.Bl -tag -width /etc/group -compact
97.It Pa /etc/group
b5dc1377 98Group ID file
0e853b88 99.El
b5dc1377
CL
100.Sh SEE ALSO
101.Xr chown 2 ,
b5dc1377 102.Xr group 5 ,
e4eb33c7 103.Xr passwd 5 ,
0d17b9a2 104.Xr fts 3 ,
c6bbda50
KB
105.Xr symlink 7 ,
106.Xr chown 8
b5dc1377
CL
107.Sh STANDARDS
108The
109.Nm chgrp
76229015 110utility is expected to be POSIX 1003.2 compatible.