Commit | Line | Data |
---|---|---|
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 | |
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: | |
0e853b88 | 30 | .Bl -tag -width Ds |
e4eb33c7 EA |
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. | |
0e853b88 | 34 | .It Fl R |
b5dc1377 | 35 | Recursively change file group IDs. |
5325ced3 CL |
36 | For each |
37 | .Ar file | |
b5dc1377 CL |
38 | operand that names a directory, chgrp changes the |
39 | group of the directory and all files in the file | |
40 | hierarchy below it. | |
2da69ef2 KM |
41 | When symbolic links are encountered, their group is changed, |
42 | but they are not traversed. | |
0e853b88 | 43 | .It Fl f |
b5dc1377 | 44 | The force option ignores errors, except for usage errors and doesn't |
76229015 | 45 | query about strange modes (unless the user does not have proper permissions). |
e4eb33c7 EA |
46 | .It Fl h |
47 | When encountering a symbolic link anywhere in the traversal, follow it. | |
0e853b88 | 48 | .El |
b5dc1377 | 49 | .Pp |
76229015 | 50 | The group of a symbolic link is immutable, so unless the |
e4eb33c7 EA |
51 | .Fl h |
52 | or | |
53 | .Fl H | |
76229015 | 54 | flag is set, |
e4eb33c7 EA |
55 | .Nm chgrp |
56 | on a symbolic link is a no-op. | |
57 | .Pp | |
b5dc1377 | 58 | Operands: |
0e853b88 CL |
59 | .Bl -tag -width group |
60 | .It Ar group | |
b5dc1377 CL |
61 | The |
62 | .Ar group | |
63 | can be either a group name from the group database, or a numeric | |
64 | group ID. | |
0e853b88 | 65 | .It Ar file |
b5dc1377 | 66 | A pathname of a file whose group ID is to be modified. |
0e853b88 | 67 | .El |
b5dc1377 CL |
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 | |
0e853b88 CL |
77 | .Bl -tag -width /etc/group -compact |
78 | .It Pa /etc/group | |
b5dc1377 | 79 | Group 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 |
89 | The | |
90 | .Nm chgrp | |
76229015 | 91 | utility is expected to be POSIX 1003.2 compatible. |
5325ced3 | 92 | This manual page is derived from the POSIX 1003.2 manual page. |