1 .\" $OpenBSD: chflags.1,v 1.13 2010/09/03 09:53:20 jmc Exp $
2 .\" $NetBSD: chflags.1,v 1.4 1995/08/31 22:50:22 jtc Exp $
4 .\" Copyright (c) 1989, 1990, 1993, 1994
5 .\" The Regents of the University of California. All rights reserved.
7 .\" This code is derived from software contributed to Berkeley by
8 .\" the Institute of Electrical and Electronics Engineers, Inc.
10 .\" Redistribution and use in source and binary forms, with or without
11 .\" modification, are permitted provided that the following conditions
13 .\" 1. Redistributions of source code must retain the above copyright
14 .\" notice, this list of conditions and the following disclaimer.
15 .\" 2. Redistributions in binary form must reproduce the above copyright
16 .\" notice, this list of conditions and the following disclaimer in the
17 .\" documentation and/or other materials provided with the distribution.
18 .\" 3. Neither the name of the University nor the names of its contributors
19 .\" may be used to endorse or promote products derived from this software
20 .\" without specific prior written permission.
22 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .\" @(#)chflags.1 8.4 (Berkeley) 5/2/95
36 .Dd $Mdocdate: September 3 2010 $
53 utility modifies the file flags of the listed files
59 of a file dictate special restrictions beyond those enforced by its
61 Only the superuser can change the user flags on block and
66 to see the flags of existing files.
68 The options are as follows:
73 option is also specified, symbolic links on the command line are followed.
74 (Symbolic links encountered in the tree traversal are not followed.)
78 option is also specified, all symbolic links are followed.
82 option is also specified, no symbolic links are followed.
84 Recursively descend through any specified directory arguments.
85 Change the flags of the file hierarchies rooted
86 in the files instead of just the files themselves.
89 Flags are a comma separated list of keywords.
90 The following keywords are currently defined:
91 .Bd -literal -offset indent
92 arch set the archived flag (superuser only)
93 nodump set the nodump flag (owner or superuser only)
94 sappnd set the system append-only flag (superuser only)
95 schg set the system immutable flag (superuser only)
96 uappnd set the user append-only flag (owner or superuser only)
97 uchg set the user immutable flag (owner or superuser only)
102 flag is for compatibility only,
103 and currently has no effect.
107 flag set will by default only be backed up by
114 can be used to alter this.
116 An immutable file may not be changed, moved, or deleted.
117 An append-only file is immutable except that data may be appended to it.
124 flags can be set at any time, but may only be cleared when the system is
125 running at security level 0 or \-1
126 (insecure or permanently insecure mode, respectively).
127 For more information on setting the system security level,
133 before a flag name causes the flag to be turned off.
136 .Dl nouchg the immutable bit should be cleared
138 Symbolic links do not have flags, so unless the
144 on a symbolic link always succeeds and has no effect.
150 options are ignored unless the
153 In addition, these options override each other and the
154 command's actions are determined by the last one specified.
168 command first appeared in