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 .\" 4. 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: src/bin/chflags/chflags.1,v 1.30 2008/03/09 12:10:24 rwatson Exp $
34 .\" $DragonFly: src/usr.bin/chflags/chflags.1,v 1.8 2008/11/12 15:18:26 swildner Exp $
47 .Op Fl H | Fl L | Fl P
54 utility modifies the file flags of the listed files
59 The options are as follows:
60 .Bl -tag -width indent
62 Do not display a diagnostic message if
64 could not modify the flags for
66 nor modify the exit status to reflect such failures.
70 option is specified, symbolic links on the command line are followed.
71 (Symbolic links encountered in the tree 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 for the file hierarchies rooted
89 in the files instead of just the files themselves.
93 to be verbose, showing filenames as the flags are modified.
96 option is specified more than once, the old and new flags of the file
97 will also be printed, in octal notation.
100 The flags are specified as an octal number or a comma separated list
102 The following keywords are currently defined:
103 .Bl -tag -offset indent -width ".Cm nouhistory"
104 .It Cm arch , archived
105 set the archived flag (super-user only)
107 set the opaque flag (owner or super-user only)
109 set the nodump flag (owner or super-user only)
111 set the system nohistory flag (super-user only)
112 .It Cm nouhistory , nohistory
113 set the user nohistory flag (owner or super-user only)
114 .It Cm sappnd , sappend
115 set the system append-only flag (super-user only)
116 .It Cm schg , schange , simmutable
117 set the system immutable flag (super-user only)
118 .It Cm sunlnk , sunlink
119 set the system undeletable flag (super-user only)
120 .It Cm uappnd , uappend
121 set the user append-only flag (owner or super-user only)
122 .It Cm uchg , uchange , uimmutable
123 set the user immutable flag (owner or super-user only)
124 .It Cm uunlnk , uunlink
125 set the user undeletable flag (owner or super-user only)
126 .It Cm cache , ucache
129 (recursive, does not cross mounts) (owner or super-user only)
133 (recursive, does not cross mounts) (super-user only)
138 prefix is added or removed from a keyword, the meaning is negated.
141 .Bl -tag -offset indent -width "nouchg" -compact
143 clear the user immutable flag (owner or super-user only)
145 clear the nodump flag (owner or super-user only)
148 A few of the octal values include:
149 .Bl -tag -offset indent -width ".Li 10"
151 Clear all file flags.
178 Other combinations of keywords may be placed by using
179 the octets assigned; however, these are the most notable.
188 on a symbolic link always succeeds and has no effect.
194 options are ignored unless the
197 In addition, these options override each other and the
198 command's actions are determined by the last one specified.
202 to see the flags of existing files.
204 Note that the ability to change certain flags is dependent
205 on the current kernel
210 for more information on this setting.
214 bit may be set to enable
219 may be used to disable
221 data caching and overrides the user flag.
223 The flag is recursive but does not cross mount points.
224 Setting it on a top-level directories or mount point will
225 automatically apply the flag to the entire subtree or until
226 a mount point is hit.
227 You may have to refresh the namecache with a dummy
229 command after changing the flag in a top level directory.
230 You do not have to recursive set the flag with
233 and, in fact, we do not recommend it under any circumstances.
234 Filesystems which do not support flags generally have a
236 mount option to enable swapcache operation on the mount.
238 If you intend to use swapcache data the
239 .Cm vm.swapcache.use_chflags
240 sysctl determines whether the
242 flags are used or not.
244 .Cm vm.swapcache.data_enable
245 is turned on, data caching is turned on globally and the
246 file flags are ignored.
249 is turned on along with
251 then only subtrees marked cacheable will be swapcached.
253 You would typically want to enable the cache on
259 Alternatively if you want to cache
262 doesn't work), you can set the flag on
263 some parent directory, possibly even the root
266 and then selectively disable it in places where you don't want it.
268 This only applies to data caching.
269 Meta-data caching is universal when enabled.
283 command first appeared in
286 Only a limited number of utilities are
289 Some of these tools include
297 In particular a tool which is not currently