file_cmds-184.tar.gz
[apple/file_cmds.git] / 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: src/bin/chflags/chflags.1,v 1.25 2005/06/14 08:25:54 ru Exp $
34 .\"
35 .Dd May 14, 2005
36 .Dt CHFLAGS 1
37 .Os
38 .Sh NAME
39 .Nm chflags
40 .Nd change file flags
41 .Sh SYNOPSIS
42 .Nm
43 .Oo
44 .Fl R
45 .Op Fl H | Fl L | Fl P
46 .Oc
47 .Ar flags
48 .Ar
49 .Sh DESCRIPTION
50 The
51 .Nm
52 utility modifies the file flags of the listed files
53 as specified by the
54 .Ar flags
55 operand.
56 .Pp
57 The options are as follows:
58 .Bl -tag -width indent
59 .It Fl H
60 If the
61 .Fl R
62 option is specified, symbolic links on the command line are followed.
63 (Symbolic links encountered in the tree traversal are not followed.)
64 .It Fl L
65 If the
66 .Fl R
67 option is specified, all symbolic links are followed.
68 .It Fl P
69 If the
70 .Fl R
71 option is specified, no symbolic links are followed.
72 This is the default.
73 .It Fl R
74 Change the file flags for the file hierarchies rooted
75 in the files instead of just the files themselves.
76 .El
77 .Pp
78 The flags are specified as an octal number or a comma separated list
79 of keywords.
80 The following keywords are currently defined:
81 .Pp
82 .Bl -tag -offset indent -width ".Ar opaque"
83 .It Ar arch , archived
84 set the archived flag (super-user only)
85 .It Ar opaque
86 set the opaque flag (owner or super-user only).
87 [Directory is opaque when viewed through a union mount]
88 .It Ar nodump
89 set the nodump flag (owner or super-user only)
90 .It Ar sappnd , sappend
91 set the system append-only flag (super-user only)
92 .It Ar schg , schange , simmutable
93 set the system immutable flag (super-user only)
94 .It Ar uappnd , uappend
95 set the user append-only flag (owner or super-user only)
96 .It Ar uchg , uchange , uimmutable
97 set the user immutable flag (owner or super-user only)
98 .It Ar hidden
99 set the hidden flag
100 [Hide item from GUI]
101 .El
102 .Pp
103 As discussed in
104 .Xr chflags 2 ,
105 the
106 .Ar sappnd
107 and
108 .Ar schg
109 flags may only be unset when the system is in single-user mode.
110 .Pp
111 Putting the letters
112 .Dq Ar no
113 before or removing the letters
114 .Dq Ar no
115 from a keyword causes the flag to be cleared.
116 For example:
117 .Pp
118 .Bl -tag -offset indent -width "nouchg" -compact
119 .It Ar nouchg
120 clear the user immutable flag (owner or super-user only)
121 .It Ar dump
122 clear the nodump flag (owner or super-user only)
123 .El
124 .Pp
125 Unless the
126 .Fl H
127 or
128 .Fl L
129 options are given,
130 .Nm
131 on a symbolic link always succeeds and has no effect.
132 The
133 .Fl H ,
134 .Fl L
135 and
136 .Fl P
137 options are ignored unless the
138 .Fl R
139 option is specified.
140 In addition, these options override each other and the
141 command's actions are determined by the last one specified.
142 .Pp
143 You can use "ls -lO" to see the flags of existing files.
144 .Sh EXIT STATUS
145 .Ex -std
146 .Sh SEE ALSO
147 .Xr ls 1 ,
148 .Xr chflags 2 ,
149 .Xr stat 2 ,
150 .Xr fts 3 ,
151 .Xr symlink 7
152 .Sh HISTORY
153 The
154 .Nm
155 command first appeared in
156 .Bx 4.4 .
157 .Sh BUGS
158 Only a limited number of utilities are
159 .Nm
160 aware.
161 Some of these tools include
162 .Xr ls 1 ,
163 .Xr cp 1 ,
164 .Xr find 1 ,
165 .Xr install 1 ,
166 .Xr dump 8 ,
167 and
168 .Xr restore 8 .
169 In particular a tool which is not currently
170 .Nm
171 aware is the
172 .Xr pax 1
173 utility.