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 | .\" | |
74ee26c2 | 9 | .\" @(#)chflags.1 5.2 (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 | |
74ee26c2 EA |
45 | The flags of a symbolic link are immutable, so that unless the |
46 | .Fl h | |
47 | or | |
48 | .Fl H | |
49 | flags are set, | |
50 | .Nm chflags | |
51 | on a symbolic link is a no-op. | |
dc986658 KM |
52 | .Pp |
53 | Only the owner of a file or the super-user is permitted to change | |
54 | the low 16-bits in the flags of a file. | |
55 | Only the the super-user is permitted to change | |
56 | the high 16-bits in the flags of a file. | |
57 | .Pp | |
58 | The | |
59 | .Nm chflags | |
60 | utility exits 0 on success, and >0 if an error occurs. | |
61 | .Sh FLAGS | |
62 | Flags may be absolute or symbolic. | |
63 | An absolute flag is an octal number constructed by | |
64 | .Ar or'ing | |
65 | the following values: | |
66 | .Pp | |
67 | .Bl -tag -width 6n -compact -offset indent | |
68 | .It Li 1 | |
69 | the file should never be dumped | |
70 | .El | |
71 | .Pp | |
72 | The symbolic flags is a comma separated list of keywords. | |
73 | The following keywords are defined: | |
74 | .Bd -literal -offset indent | |
75 | dump cause the file to be dumped when it is next modified | |
76 | .Ed | |
77 | .Pp | |
78 | Putting the word ``no'' before an option causes it to be deleted. | |
79 | For example: | |
80 | .Bd -literal -offset indent | |
81 | nodump the file should never be dumped | |
82 | .Ed | |
83 | .Sh SEE ALSO | |
84 | .Xr chflags 2 , | |
85 | .Xr stat 2 , | |
86 | .Xr fts 3 |