try to make sure that path-addrs always have <angle brackets>
[unix-history] / usr / src / usr.sbin / chown / chgrp.1
CommitLineData
4459015a
KB
1.\" Copyright (c) 1983, 1990, 1993
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.\"
4459015a 9.\" @(#)chgrp.1 8.1 (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
e4eb33c7 19.Op Fl HRfh
b5dc1377
CL
20.Ar group
21.Ar files ...
22.Sh DESCRIPTION
23The chgrp utility sets the group ID of the file named by each
24.Ar file
25operand to the
26.Ar group
27ID specified by the group operand.
28.Pp
29Options:
0e853b88 30.Bl -tag -width Ds
e4eb33c7
EA
31.It Fl H
32When encountering a symbolic link on the command line, follow it. All other
33symbolic links encountered in the traversal are not followed.
0e853b88 34.It Fl R
b5dc1377 35Recursively change file group IDs.
5325ced3
CL
36For each
37.Ar file
b5dc1377
CL
38operand that names a directory, chgrp changes the
39group of the directory and all files in the file
40hierarchy below it.
2da69ef2
KM
41When symbolic links are encountered, their group is changed,
42but they are not traversed.
0e853b88 43.It Fl f
b5dc1377 44The force option ignores errors, except for usage errors and doesn't
76229015 45query about strange modes (unless the user does not have proper permissions).
e4eb33c7
EA
46.It Fl h
47When encountering a symbolic link anywhere in the traversal, follow it.
0e853b88 48.El
b5dc1377 49.Pp
76229015 50The group of a symbolic link is immutable, so unless the
e4eb33c7
EA
51.Fl h
52or
53.Fl H
76229015 54flag is set,
e4eb33c7
EA
55.Nm chgrp
56on a symbolic link is a no-op.
57.Pp
b5dc1377 58Operands:
0e853b88
CL
59.Bl -tag -width group
60.It Ar group
b5dc1377
CL
61The
62.Ar group
63can be either a group name from the group database, or a numeric
64group ID.
0e853b88 65.It Ar file
b5dc1377 66A pathname of a file whose group ID is to be modified.
0e853b88 67.El
b5dc1377
CL
68.Pp
69The user invoking
70must belong
71to the specified group and be the owner of the file, or be the super-user.
72.Pp
73The
74.Nm chgrp
75utility exits 0 on success, and >0 if an error occurs.
76.Sh FILES
0e853b88
CL
77.Bl -tag -width /etc/group -compact
78.It Pa /etc/group
b5dc1377 79Group ID file
0e853b88 80.El
b5dc1377
CL
81.Sh SEE ALSO
82.Xr chown 2 ,
83.Xr chown 8 ,
84.Xr group 5 ,
e4eb33c7 85.Xr passwd 5 ,
0d17b9a2
KB
86.Xr fts 3 ,
87.Xr symlink 7
b5dc1377
CL
88.Sh STANDARDS
89The
90.Nm chgrp
76229015 91utility is expected to be POSIX 1003.2 compatible.
5325ced3 92This manual page is derived from the POSIX 1003.2 manual page.