Commit | Line | Data |
---|---|---|
dc986658 KM |
1 | .\" Copyright (c) 1989, 1990 The Regents of the University of California. |
2 | .\" 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.roff% | |
8 | .\" | |
13de2e6a | 9 | .\" @(#)chflags.1 8.1 (Berkeley) %G% |
dc986658 KM |
10 | .\" |
11 | .Dd | |
12 | .Dt CHFLAGS 1 | |
13 | .Os | |
14 | .Sh NAME | |
15 | .Nm chflags | |
16 | .Nd change file flags | |
17 | .Sh SYNOPSIS | |
18 | .Nm chflags | |
74ee26c2 | 19 | .Op Fl HRh |
dc986658 KM |
20 | .Ar flags |
21 | .Ar file ... | |
22 | .Sh DESCRIPTION | |
23 | The | |
24 | .Nm chflags | |
25 | utility modifies the file flags of the listed files | |
26 | as specified by the | |
27 | .Ar flags | |
28 | operand. | |
29 | .Pp | |
30 | The options are as follows: | |
31 | .Bl -tag -width Ds | |
74ee26c2 EA |
32 | .It Fl H |
33 | When encountering a symbolic link on the command line, follow it. All other | |
34 | symbolic links encountered in the traversal are not followed. | |
dc986658 KM |
35 | .It Fl R |
36 | Traverse a file hierarchy. | |
37 | For each file that is of type directory, | |
38 | .Nm chflags | |
39 | changes the flags of all files in the file hierarchy below it followed | |
40 | by the flags of the directory itself. | |
74ee26c2 EA |
41 | .It Fl h |
42 | When encountering a symbolic link anywhere in the traversal, follow it. | |
dc986658 KM |
43 | .El |
44 | .Pp | |
8a499f2f KB |
45 | Flags are a comma separated list of keywords. |
46 | The following keywords are currently defined: | |
47 | .Bd -literal -offset indent compact | |
48 | .\"arch nothing yet. | |
49 | dump set the dump flag | |
b0a4b439 KM |
50 | sappnd set the system append-only flag (super-user only) |
51 | schg set the system immutable flag (super-user only) | |
52 | uappnd set the user append-only flag (owner or super-user only) | |
53 | uchg set the user immutable flag (owner or super-user only) | |
8a499f2f KB |
54 | .Ed |
55 | .Pp | |
56 | Putting the letters | |
57 | .Dq no | |
58 | before an option causes the flag to be turned off. | |
59 | For example: | |
60 | .Bd -literal -offset indent compact | |
61 | nodump the file should never be dumped | |
62 | .Ed | |
63 | .Pp | |
74ee26c2 EA |
64 | The flags of a symbolic link are immutable, so that unless the |
65 | .Fl h | |
66 | or | |
67 | .Fl H | |
68 | flags are set, | |
69 | .Nm chflags | |
8a499f2f | 70 | on a symbolic link always succeeds and has no effect. |
dc986658 KM |
71 | .Pp |
72 | The | |
73 | .Nm chflags | |
74 | utility exits 0 on success, and >0 if an error occurs. | |
dc986658 KM |
75 | .Sh SEE ALSO |
76 | .Xr chflags 2 , | |
77 | .Xr stat 2 , | |
0d17b9a2 KB |
78 | .Xr fts 3 , |
79 | .Xr symlink 7 |