xref: /csrg-svn/usr.sbin/chown/chgrp.1 (revision 53774)
143082Scael.\" Copyright (c) 1983, 1990 The Regents of the University of California.
243082Scael.\" All rights reserved.
319699Smckusick.\"
450180Sbostic.\" This code is derived from software contributed to Berkeley by
550180Sbostic.\" the Institute of Electrical and Electronics Engineers, Inc.
650180Sbostic.\"
743082Scael.\" %sccs.include.redist.man%
819699Smckusick.\"
9*53774Selan.\"     @(#)chgrp.1	6.8 (Berkeley) 06/01/92
1043082Scael.\"
1143082Scael.Dd
1243082Scael.Dt CHGRP 1
1343082Scael.Os BSD 4.2
1443082Scael.Sh NAME
1543082Scael.Nm chgrp
1643082Scael.Nd change group
1743082Scael.Sh SYNOPSIS
1843082Scael.Nm chgrp
19*53774Selan.Op Fl HRfh
2043082Scael.Ar group
2143082Scael.Ar files ...
2243082Scael.Sh DESCRIPTION
2343082ScaelThe chgrp utility sets the group ID of the file named by each
2443082Scael.Ar file
2543082Scaeloperand to the
2643082Scael.Ar group
2743082ScaelID specified by the group operand.
2843082Scael.Pp
2943082ScaelOptions:
3047399Scael.Bl -tag -width Ds
31*53774Selan.It Fl H
32*53774SelanWhen encountering a symbolic link on the command line, follow it.  All other
33*53774Selansymbolic links encountered in the traversal are not followed.
3447399Scael.It Fl R
3543082ScaelRecursively change file group IDs.
3644952ScaelFor each
3744952Scael.Ar file
3843082Scaeloperand that names a directory, chgrp changes the
3943082Scaelgroup of the directory and all files in the file
4043082Scaelhierarchy below it.
4143082ScaelWhen symbolic links are encountered, their group is changed,
4243082Scaelbut they are not traversed.
4347399Scael.It Fl f
4443082ScaelThe force option ignores errors, except for usage errors and doesn't
4543082Scaelquery about strange modes (unless user does not have proper permissions).
46*53774Selan.It Fl h
47*53774SelanWhen encountering a symbolic link anywhere in the traversal, follow it.
4847399Scael.El
4943082Scael.Pp
50*53774SelanThe group of a symbolic link is immutable, so that unless the
51*53774Selan.Fl h
52*53774Selanor
53*53774Selan.Fl H
54*53774Selanflags are set,
55*53774Selan.Nm chgrp
56*53774Selanon a symbolic link is a no-op.
57*53774Selan.Pp
5843082ScaelOperands:
5947399Scael.Bl -tag -width group
6047399Scael.It Ar group
6143082ScaelThe
6243082Scael.Ar group
6343082Scaelcan be either a group name from the group database, or a numeric
6443082Scaelgroup ID.
6547399Scael.It Ar file
6643082ScaelA pathname of a file whose group ID is to be modified.
6747399Scael.El
6843082Scael.Pp
6943082ScaelThe user invoking
7019699Smckusickmust belong
7119699Smckusickto the specified group and be the owner of the file, or be the super-user.
7243082Scael.Pp
7343082ScaelThe
7443082Scael.Nm chgrp
7543082Scaelutility exits 0 on success, and >0 if an error occurs.
7643082Scael.Sh FILES
7747399Scael.Bl -tag -width /etc/group -compact
7847399Scael.It Pa /etc/group
7943082ScaelGroup ID file
8047399Scael.El
8143082Scael.Sh SEE ALSO
8243082Scael.Xr chown 2 ,
8343082Scael.Xr chown 8 ,
8443082Scael.Xr group 5 ,
85*53774Selan.Xr passwd 5 ,
86*53774Selan.Xr fts 3
8743082Scael.Sh STANDARDS
8843082ScaelThe
8943082Scael.Nm chgrp
9043082Scaelfunction is expected to be POSIX 1003.2 compatible.
9144952ScaelThis manual page is derived from the POSIX 1003.2 manual page.
92