.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)chgrp.1 8.3 (Berkeley) 3/31/94
-.\" $NetBSD: chgrp.1,v 1.10 1997/12/21 18:11:19 kleink Exp $
+.\" @(#)chgrp.1 8.3 (Berkeley) 3/31/94
+.\" $FreeBSD: src/usr.sbin/chown/chgrp.1,v 1.13 2001/08/15 09:09:46 ru Exp $
.\"
.Dd March 31, 1994
.Dt CHGRP 1
-.Os BSD 4.2
+.Os
.Sh NAME
.Nm chgrp
.Nd change group
.Sh SYNOPSIS
-.Nm
+.Nm chgrp
+.Op Fl fhnv
.Oo
.Fl R
.Op Fl H | Fl L | Fl P
.Oc
-.Op Fl fh
.Ar group
-.Ar files ...
+.Ar
.Sh DESCRIPTION
The
-.Nm
+.Nm chgrp
utility sets the group ID of the file named by each
.Ar file
operand to the
.Ar group
ID specified by the group operand.
.Pp
-Options:
-.Bl -tag -width Ds
+The following options are available:
+.Bl -tag -width indent
+.It Fl f
+The force option ignores errors, except for usage errors and doesn't
+query about strange modes (unless the user does not have proper permissions).
.It Fl H
If the
.Fl R
option is specified, symbolic links on the command line are followed.
-(Symbolic links encountered in the tree traversal are not followed.)
+(Symbolic links encountered in the tree traversal are not followed).
+.It Fl h
+If the file is a symbolic link, the group ID of the link itself is changed
+rather than the file that is pointed to.
.It Fl L
If the
.Fl R
If the
.Fl R
option is specified, no symbolic links are followed.
+This is the default. Use
+.Fl h
+to change the group ID of a symbolic link.
.It Fl R
Change the group ID for the file hierarchies rooted
in the files instead of just the files themselves.
-.It Fl f
-The force option ignores errors, except for usage errors and doesn't
-query about strange modes (unless the user does not have proper permissions).
-.It Fl h
-If
-.Ar file
-is a symbolic link, the group of the link is changed.
+.It Fl n
+Interpret the group ID as numeric, avoiding the name lookup.
+.It Fl v
+Cause
+.Nm chgrp
+to be verbose, showing files as the group is modified.
.El
.Pp
-If
-.Fl h
-is not given, unless the
-.Fl H
-or
-.Fl L
-option is set,
-.Nm
-on a symbolic link always succeeds and has no effect.
The
.Fl H ,
.Fl L
group name.
.Pp
The user invoking
-.Nm
+.Nm chgrp
must belong to the specified group and be the owner of the file,
or be the super-user.
-.Pp
-Unless invoked by the super-user,
-.Nm
-clears the set-user-id and set-group-id bits on a file to prevent
-accidental or mischievous creation of set-user-id or set-group-id
-programs.
+.Sh DIAGNOSTICS
+.Ex -std
+.Sh COMPATIBILITY
+In previous versions of this system, symbolic links did not have groups.
.Pp
The
-.Nm
-utility exits 0 on success, and >0 if an error occurs.
+.Fl v
+option is non-standard and its use in scripts is not recommended.
.Sh FILES
.Bl -tag -width /etc/group -compact
.It Pa /etc/group
-Group ID file
+group ID file
.El
.Sh SEE ALSO
.Xr chown 2 ,
-.Xr lchown 2 ,
.Xr fts 3 ,
.Xr group 5 ,
.Xr passwd 5 ,
.Xr chown 8
.Sh STANDARDS
The
-.Nm
-utility is expected to be POSIX 1003.2 compatible.
+.Nm chgrp
+utility is expected to be
+.St -p1003.2
+compatible.