changes for whiteouts and union filesystem
[unix-history] / usr / src / usr.bin / chflags / chflags.1
CommitLineData
f49acbb1 1.\" Copyright (c) 1989, 1990, 1993, 1994
1de392d7 2.\" The Regents of the University of California. All rights reserved.
dc986658
KM
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" the Institute of Electrical and Electronics Engineers, Inc.
6.\"
7.\" %sccs.include.redist.roff%
8.\"
88edbcd4 9.\" @(#)chflags.1 8.3 (Berkeley) %G%
dc986658
KM
10.\"
11.Dd
12.Dt CHFLAGS 1
13.Os
14.Sh NAME
15.Nm chflags
16.Nd change file flags
17.Sh SYNOPSIS
18.Nm chflags
f49acbb1
KB
19.Oo
20.Fl R
21.Op Fl H | Fl L | Fl P
22.Oc
dc986658
KM
23.Ar flags
24.Ar file ...
25.Sh DESCRIPTION
26The
27.Nm chflags
28utility modifies the file flags of the listed files
29as specified by the
30.Ar flags
31operand.
32.Pp
33The options are as follows:
34.Bl -tag -width Ds
74ee26c2 35.It Fl H
f49acbb1
KB
36If the
37.Fl R
38option is specified, symbolic links on the command line are followed.
39(Symbolic links encountered in the tree traversal are not followed.)
40.It Fl L
41If the
42.Fl R
43option is specified, all symbolic links are followed.
44.It Fl P
45If the
46.Fl R
47option is specified, no symbolic links are followed.
dc986658 48.It Fl R
f49acbb1
KB
49Change the file flags for the file hierarchies rooted
50in the files instead of just the files themselves.
dc986658
KM
51.El
52.Pp
8a499f2f
KB
53Flags are a comma separated list of keywords.
54The following keywords are currently defined:
55.Bd -literal -offset indent compact
56.\"arch nothing yet.
88edbcd4 57opaque set the opaque flag
8a499f2f 58dump set the dump flag
b0a4b439
KM
59sappnd set the system append-only flag (super-user only)
60schg set the system immutable flag (super-user only)
61uappnd set the user append-only flag (owner or super-user only)
62uchg set the user immutable flag (owner or super-user only)
8a499f2f
KB
63.Ed
64.Pp
65Putting the letters
66.Dq no
67before an option causes the flag to be turned off.
68For example:
69.Bd -literal -offset indent compact
70nodump the file should never be dumped
71.Ed
72.Pp
f49acbb1 73Symbolic links do not have flags, so unless the
74ee26c2 74.Fl H
f49acbb1
KB
75or
76.Fl L
77option is set,
74ee26c2 78.Nm chflags
8a499f2f 79on a symbolic link always succeeds and has no effect.
f49acbb1
KB
80The
81.Fl H ,
82.Fl L
83and
84.Fl P
85options are ignored unless the
86.Fl R
87option is specified.
88In addition, these options override each other and the
89command's actions are determined by the last one specified.
dc986658
KM
90.Pp
91The
92.Nm chflags
93utility exits 0 on success, and >0 if an error occurs.
dc986658
KM
94.Sh SEE ALSO
95.Xr chflags 2 ,
96.Xr stat 2 ,
0d17b9a2
KB
97.Xr fts 3 ,
98.Xr symlink 7