xref: /freebsd/bin/chflags/chflags.1 (revision afe61c15161c324a7af299a9b8457aba5afc92db)
1.\" Copyright (c) 1989, 1990, 1993, 1994
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" the Institute of Electrical and Electronics Engineers, Inc.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. All advertising materials mentioning features or use of this software
16.\"    must display the following acknowledgement:
17.\"	This product includes software developed by the University of
18.\"	California, Berkeley and its contributors.
19.\" 4. Neither the name of the University nor the names of its contributors
20.\"    may be used to endorse or promote products derived from this software
21.\"    without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
35.\"	@(#)chflags.1	8.2 (Berkeley) 3/31/94
36.\"
37.Dd March 31, 1994
38.Dt CHFLAGS 1
39.Os
40.Sh NAME
41.Nm chflags
42.Nd change file flags
43.Sh SYNOPSIS
44.Nm chflags
45.Oo
46.Fl R
47.Op Fl H | Fl L | Fl P
48.Oc
49.Ar flags
50.Ar file ...
51.Sh DESCRIPTION
52The
53.Nm chflags
54utility modifies the file flags of the listed files
55as specified by the
56.Ar flags
57operand.
58.Pp
59The options are as follows:
60.Bl -tag -width Ds
61.It Fl H
62If the
63.Fl R
64option is specified, symbolic links on the command line are followed.
65(Symbolic links encountered in the tree traversal are not followed.)
66.It Fl L
67If the
68.Fl R
69option is specified, all symbolic links are followed.
70.It Fl P
71If the
72.Fl R
73option is specified, no symbolic links are followed.
74.It Fl R
75Change the file flags for the file hierarchies rooted
76in the files instead of just the files themselves.
77.El
78.Pp
79Flags are a comma separated list of keywords.
80The following keywords are currently defined:
81.Bd -literal -offset indent compact
82.\"arch	nothing yet.
83dump	set the dump flag
84sappnd	set the system append-only flag (super-user only)
85schg	set the system immutable flag (super-user only)
86uappnd	set the user append-only flag (owner or super-user only)
87uchg	set the user immutable flag (owner or super-user only)
88.Ed
89.Pp
90Putting the letters
91.Dq no
92before an option causes the flag to be turned off.
93For example:
94.Bd -literal -offset indent compact
95nodump	the file should never be dumped
96.Ed
97.Pp
98Symbolic links do not have flags, so unless the
99.Fl H
100or
101.Fl L
102option is set,
103.Nm chflags
104on a symbolic link always succeeds and has no effect.
105The
106.Fl H ,
107.Fl L
108and
109.Fl P
110options are ignored unless the
111.Fl R
112option is specified.
113In addition, these options override each other and the
114command's actions are determined by the last one specified.
115.Pp
116The
117.Nm chflags
118utility exits 0 on success, and >0 if an error occurs.
119.Sh SEE ALSO
120.Xr chflags 2 ,
121.Xr stat 2 ,
122.Xr fts 3 ,
123.Xr symlink 7
124