Commit | Line | Data |
---|---|---|
c6bbda50 | 1 | .\" Copyright (c) 1983, 1990, 1993, 1994 |
4459015a | 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 | .\" |
8fbabe2e | 9 | .\" @(#)chgrp.1 8.3 (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 | |
c6bbda50 KB |
19 | .Oo |
20 | .Fl R | |
21 | .Op Fl H | Fl L | Fl P | |
22 | .Oc | |
23 | .Op Fl f | |
b5dc1377 CL |
24 | .Ar group |
25 | .Ar files ... | |
26 | .Sh DESCRIPTION | |
27 | The chgrp utility sets the group ID of the file named by each | |
28 | .Ar file | |
29 | operand to the | |
30 | .Ar group | |
31 | ID specified by the group operand. | |
32 | .Pp | |
33 | Options: | |
0e853b88 | 34 | .Bl -tag -width Ds |
e4eb33c7 | 35 | .It Fl H |
c6bbda50 KB |
36 | If the |
37 | .Fl R | |
38 | option is specified, symbolic links on the command line are followed. | |
39 | (Symbolic links encountered in the tree traversal are not followed.) | |
40 | .It Fl L | |
41 | If the | |
42 | .Fl R | |
43 | option is specified, all symbolic links are followed. | |
44 | .It Fl P | |
45 | If the | |
46 | .Fl R | |
47 | option is specified, no symbolic links are followed. | |
0e853b88 | 48 | .It Fl R |
c6bbda50 KB |
49 | Change the group ID for the file hierarchies rooted |
50 | in the files instead of just the files themselves. | |
0e853b88 | 51 | .It Fl f |
b5dc1377 | 52 | The force option ignores errors, except for usage errors and doesn't |
76229015 | 53 | query about strange modes (unless the user does not have proper permissions). |
0e853b88 | 54 | .El |
b5dc1377 | 55 | .Pp |
c6bbda50 | 56 | Symbolic links don't have groups, so unless the |
e4eb33c7 | 57 | .Fl H |
c6bbda50 KB |
58 | or |
59 | .Fl L | |
60 | option is set, | |
e4eb33c7 | 61 | .Nm chgrp |
8fbabe2e | 62 | on a symbolic link always succeeds and has no effect. |
c6bbda50 KB |
63 | The |
64 | .Fl H , | |
65 | .Fl L | |
66 | and | |
67 | .Fl P | |
68 | options are ignored unless the | |
69 | .Fl R | |
70 | option is specified. | |
71 | In addition, these options override each other and the | |
72 | command's actions are determined by the last one specified. | |
e4eb33c7 | 73 | .Pp |
b5dc1377 CL |
74 | The |
75 | .Ar group | |
c6bbda50 KB |
76 | operand can be either a group name from the group database, |
77 | or a numeric group ID. | |
78 | If a group name is also a numeric group ID, the operand is used as a | |
79 | group name. | |
b5dc1377 CL |
80 | .Pp |
81 | The user invoking | |
c6bbda50 KB |
82 | .Nm chgrp |
83 | must belong to the specified group and be the owner of the file, | |
84 | or be the super-user. | |
b5dc1377 CL |
85 | .Pp |
86 | The | |
87 | .Nm chgrp | |
88 | utility exits 0 on success, and >0 if an error occurs. | |
c6bbda50 KB |
89 | .Sh COMPATIBILITY |
90 | Previous versions of the | |
91 | .Nm chgrp | |
92 | utility changed the group of symbolic links specified on the command | |
93 | line. | |
94 | In this system, symbolic links do not have groups. | |
b5dc1377 | 95 | .Sh FILES |
0e853b88 CL |
96 | .Bl -tag -width /etc/group -compact |
97 | .It Pa /etc/group | |
b5dc1377 | 98 | Group ID file |
0e853b88 | 99 | .El |
b5dc1377 CL |
100 | .Sh SEE ALSO |
101 | .Xr chown 2 , | |
b5dc1377 | 102 | .Xr group 5 , |
e4eb33c7 | 103 | .Xr passwd 5 , |
0d17b9a2 | 104 | .Xr fts 3 , |
c6bbda50 KB |
105 | .Xr symlink 7 , |
106 | .Xr chown 8 | |
b5dc1377 CL |
107 | .Sh STANDARDS |
108 | The | |
109 | .Nm chgrp | |
76229015 | 110 | utility is expected to be POSIX 1003.2 compatible. |