]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - bin/chflags/chflags.1
This commit was generated by cvs2svn to compensate for changes in r171825,
[FreeBSD/FreeBSD.git] / bin / chflags / chflags.1
1 .\"-
2 .\" Copyright (c) 1989, 1990, 1993, 1994
3 .\"     The Regents of the University of California.  All rights reserved.
4 .\"
5 .\" This code is derived from software contributed to Berkeley by
6 .\" the Institute of Electrical and Electronics Engineers, Inc.
7 .\"
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
10 .\" are met:
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.
19 .\"
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
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)chflags.1   8.4 (Berkeley) 5/2/95
33 .\" $FreeBSD$
34 .\"
35 .Dd March 3, 2006
36 .Dt CHFLAGS 1
37 .Os
38 .Sh NAME
39 .Nm chflags
40 .Nd change file flags
41 .Sh SYNOPSIS
42 .Nm
43 .Op Fl h
44 .Oo
45 .Fl R
46 .Op Fl H | Fl L | Fl P
47 .Oc
48 .Ar flags
49 .Ar
50 .Sh DESCRIPTION
51 The
52 .Nm
53 utility modifies the file flags of the listed files
54 as specified by the
55 .Ar flags
56 operand.
57 .Pp
58 The options are as follows:
59 .Bl -tag -width indent
60 .It Fl H
61 If the
62 .Fl R
63 option is specified, symbolic links on the command line are followed.
64 (Symbolic links encountered in the tree traversal are not followed.)
65 .It Fl h
66 If the
67 .Ar file
68 is a symbolic link,
69 change the file flags of the link itself rather than the file to which it points.
70 .It Fl L
71 If the
72 .Fl R
73 option is specified, all symbolic links are followed.
74 .It Fl P
75 If the
76 .Fl R
77 option is specified, no symbolic links are followed.
78 This is the default.
79 .It Fl R
80 Change the file flags for the file hierarchies rooted
81 in the files instead of just the files themselves.
82 .El
83 .Pp
84 The flags are specified as an octal number or a comma separated list
85 of keywords.
86 The following keywords are currently defined:
87 .Pp
88 .Bl -tag -offset indent -width ".Cm opaque"
89 .It Cm arch , archived
90 set the archived flag (super-user only)
91 .It Cm opaque
92 set the opaque flag (owner or super-user only)
93 .It Cm nodump
94 set the nodump flag (owner or super-user only)
95 .It Cm sappnd , sappend
96 set the system append-only flag (super-user only)
97 .It Cm schg , schange , simmutable
98 set the system immutable flag (super-user only)
99 .It Cm sunlnk , sunlink
100 set the system undeletable flag (super-user only)
101 .It Cm uappnd , uappend
102 set the user append-only flag (owner or super-user only)
103 .It Cm uchg , uchange , uimmutable
104 set the user immutable flag (owner or super-user only)
105 .It Cm uunlnk , uunlink
106 set the user undeletable flag (owner or super-user only)
107 .El
108 .Pp
109 Putting the letters
110 .Dq Ar no
111 before or removing the letters
112 .Dq Ar no
113 from a keyword causes the flag to be cleared.
114 For example:
115 .Pp
116 .Bl -tag -offset indent -width "nouchg" -compact
117 .It Cm nouchg
118 clear the user immutable flag (owner or super-user only)
119 .It Cm dump
120 clear the nodump flag (owner or super-user only)
121 .El
122 .Pp
123 A few of the octal values include:
124 .Bl -tag -offset indent -width ".Li 10"
125 .It Li 0
126 Clear all file flags.
127 .It Li 1
128 Translates to the
129 .Cm nodump
130 keyword.
131 .It Li 2
132 Translates to the
133 .Cm uchg
134 keyword.
135 .It Li 3
136 Translates to the
137 .Cm uchg , nodump
138 keywords.
139 .It Li 4
140 Translates to the
141 .Cm uappnd
142 keyword.
143 .It Li 10
144 Translates to the
145 .Cm opaque
146 keyword.
147 .It Li 20
148 translates to the
149 .Cm uunlnk
150 keyword.
151 .El
152 .Pp
153 Other combinations of keywords may be placed by using
154 the octets assigned; however, these are the most notable.
155 .Pp
156 Unless the
157 .Fl H ,
158 .Fl L ,
159 or
160 .Fl h
161 options are given,
162 .Nm
163 on a symbolic link always succeeds and has no effect.
164 The
165 .Fl H ,
166 .Fl L
167 and
168 .Fl P
169 options are ignored unless the
170 .Fl R
171 option is specified.
172 In addition, these options override each other and the
173 command's actions are determined by the last one specified.
174 .Pp
175 You can use "ls -lo" to see the flags of existing files.
176 .Pp
177 Note that the ability to change certain flags is dependent
178 on the current kernel
179 .Va securelevel
180 setting.
181 See
182 .Xr security 7
183 for more information on this setting.
184 .Sh EXIT STATUS
185 .Ex -std
186 .Sh SEE ALSO
187 .Xr ls 1 ,
188 .Xr chflags 2 ,
189 .Xr stat 2 ,
190 .Xr fts 3 ,
191 .Xr security 7 ,
192 .Xr symlink 7
193 .Sh HISTORY
194 The
195 .Nm
196 command first appeared in
197 .Bx 4.4 .
198 .Sh BUGS
199 Only a limited number of utilities are
200 .Nm
201 aware.
202 Some of these tools include
203 .Xr ls 1 ,
204 .Xr cp 1 ,
205 .Xr find 1 ,
206 .Xr install 1 ,
207 .Xr dump 8 ,
208 and
209 .Xr restore 8 .
210 In particular a tool which is not currently
211 .Nm
212 aware is the
213 .Xr pax 1
214 utility.