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