2 .\" Copyright (c) 1989, 1990, 1993, 1994
3 .\" The Regents of the University of California. All rights reserved.
5 .\" This code is derived from software contributed to Berkeley by
6 .\" the Institute of Electrical and Electronics Engineers, Inc.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
15 .\" documentation and/or other materials provided with the distribution.
16 .\" 3. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)chflags.1 8.4 (Berkeley) 5/2/95
46 .Op Fl H | Fl L | Fl P
53 utility modifies the file flags of the listed files
58 The options are as follows:
59 .Bl -tag -width indent
61 Do not display a diagnostic message if
63 could not modify the flags for
65 nor modify the exit status to reflect such failures.
69 option is specified, symbolic links on the command line are followed
70 and hence unaffected by the command.
71 (Symbolic links encountered during traversal are not followed.)
76 change the file flags of the link itself rather than the file to which it points.
80 option is specified, all symbolic links are followed.
84 option is specified, no symbolic links are followed.
87 Change the file flags of the file hierarchies rooted in the files,
88 instead of just the files themselves.
89 Beware of unintentionally matching the
91 hard link to the parent directory when using wildcards like
96 to be verbose, showing filenames as the flags are modified.
99 option is specified more than once, the old and new flags of the file
100 will also be printed, in octal notation.
102 Do not cross mount points.
105 The flags are specified as an octal number or a comma separated list
107 The following keywords are currently defined:
108 .Bl -tag -offset indent -width ".Cm opaque"
109 .It Cm arch , archived
110 set the archived flag (super-user only)
112 set the nodump flag (owner or super-user only)
114 set the opaque flag (owner or super-user only)
115 .It Cm sappnd , sappend
116 set the system append-only flag (super-user only)
117 .It Cm schg , schange , simmutable
118 set the system immutable flag (super-user only)
120 set the snapshot flag (filesystems do not allow changing this flag)
121 .It Cm sunlnk , sunlink
122 set the system undeletable flag (super-user only)
123 .It Cm uappnd , uappend
124 set the user append-only flag (owner or super-user only)
125 .It Cm uarch , uarchive
126 set the archive flag (owner or super-user only)
127 .It Cm uchg , uchange , uimmutable
128 set the user immutable flag (owner or super-user only)
129 .It Cm uhidden , hidden
130 set the hidden file attribute (owner or super-user only)
131 .It Cm uoffline , offline
132 set the offline file attribute (owner or super-user only)
133 .It Cm urdonly , rdonly , readonly
134 set the DOS, Windows and CIFS readonly flag (owner or super-user only)
135 .It Cm usparse , sparse
136 set the sparse file attribute (owner or super-user only)
137 .It Cm usystem , system
138 set the DOS, Windows and CIFS system flag (owner or super-user only)
139 .It Cm ureparse , reparse
140 set the Windows reparse point file attribute (owner or super-user only)
141 .It Cm uunlnk , uunlink
142 set the user undeletable flag (owner or super-user only)
147 before or removing the letters
149 from a keyword causes the flag to be cleared.
152 .Bl -tag -offset indent -width "nouchg" -compact
154 clear the user immutable flag (owner or super-user only)
156 clear the nodump flag (owner or super-user only)
159 A few of the octal values include:
160 .Bl -tag -offset indent -width ".Li 10"
162 Clear all file flags.
189 Other combinations of keywords may be placed by using
190 the octets assigned; however, these are the most notable.
199 on a symbolic link always succeeds and has no effect.
205 options are ignored unless the
208 In addition, these options override each other and the
209 command's actions are determined by the last one specified.
211 You can use "ls -lo" to see the flags of existing files.
213 Note that the ability to change certain flags is dependent
214 on the current kernel
219 for more information on this setting.
229 then the current filename as well as the old and new flags are displayed.
233 Recursively clear all flags on files and directories contained within the
236 .Dl Nm Fl R Ar 0 Ar foobar
247 command first appeared in
250 Only a limited number of utilities are
253 Some of these tools include
261 In particular a tool which is not currently