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