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