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
33 .\" $FreeBSD: head/bin/chflags/chflags.1 282208 2015-04-29 00:49:00Z smh $
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
81 option is specified, all symbolic links are followed.
85 option is specified, no symbolic links are followed.
88 Change the file flags of the file hierarchies rooted in the files,
89 instead of just the files themselves.
90 Beware of unintentionally matching the
92 hard link to the parent directory when using wildcards like
97 to be verbose, showing filenames as the flags are modified.
100 option is specified more than once, the old and new flags of the file
101 will also be printed, in octal notation.
104 The flags are specified as an octal number or a comma separated list
106 The following keywords are currently defined:
107 .Bl -tag -offset indent -width ".Cm nouhistory"
108 .It Cm arch , archived
109 set the archived flag (super-user only)
111 set the opaque flag (owner or super-user only)
113 set the nodump flag (owner or super-user only)
115 set the system nohistory flag (super-user only)
116 .It Cm nouhistory , nohistory
117 set the user nohistory flag (owner or super-user only)
118 .It Cm sappnd , sappend
119 set the system append-only flag (super-user only)
120 .It Cm schg , schange , simmutable
121 set the system immutable flag (super-user only)
122 .It Cm sunlnk , sunlink
123 set the system undeletable flag (super-user only)
124 .It Cm uappnd , uappend
125 set the user append-only flag (owner or super-user only)
126 .It Cm uchg , uchange , uimmutable
127 set the user immutable flag (owner or super-user only)
128 .It Cm uunlnk , uunlink
129 set the user undeletable flag (owner or super-user only)
130 .It Cm cache , ucache
133 (recursive, does not cross mounts) (owner or super-user only)
137 (recursive, does not cross mounts) (super-user only)
142 prefix is added or removed from a keyword, the meaning is negated.
145 .Bl -tag -offset indent -width "nouchg" -compact
147 clear the user immutable flag (owner or super-user only)
149 clear the nodump flag (owner or super-user only)
152 A few of the octal values include:
153 .Bl -tag -offset indent -width ".Li 10"
155 Clear all file flags.
182 Other combinations of keywords may be placed by using
183 the octets assigned; however, these are the most notable.
192 on a symbolic link always succeeds and has no effect.
198 options are ignored unless the
201 In addition, these options override each other and the
202 command's actions are determined by the last one specified.
206 to see the flags of existing files.
208 Note that the ability to change certain flags is dependent
209 on the current kernel
214 for more information on this setting.
218 bit may be set to enable
223 may be used to disable
225 data caching and overrides the user flag.
227 The flag is recursive but does not cross mount points.
228 Setting it on a top-level directories or mount point will
229 automatically apply the flag to the entire subtree or until
230 a mount point is hit.
231 You may have to refresh the namecache with a dummy
233 command after changing the flag in a top level directory.
234 You do not have to recursive set the flag with
237 and, in fact, we do not recommend it under any circumstances.
238 Filesystems which do not support flags generally have a
240 mount option to enable swapcache operation on the mount.
242 If you intend to use swapcache data the
243 .Cm vm.swapcache.use_chflags
244 sysctl determines whether the
246 flags are used or not.
248 .Cm vm.swapcache.data_enable
249 is turned on, data caching is turned on globally and the
250 file flags are ignored.
253 is turned on along with
255 then only subtrees marked cacheable will be swapcached.
257 You would typically want to enable the cache on
263 Alternatively if you want to cache
266 doesn't work), you can set the flag on
267 some parent directory, possibly even the root
270 and then selectively disable it in places where you don't want it.
272 This only applies to data caching.
273 Meta-data caching is universal when enabled.
287 command first appeared in
290 Only a limited number of utilities are
293 Some of these tools include
301 In particular a tool which is not currently