Annotation of src/usr.bin/chflags/chflags.1, Revision 1.7
1.7 ! aaron 1: .\" $OpenBSD: chflags.1,v 1.6 1999/07/31 03:55:28 deraadt 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.
1.7 ! aaron 61: The
! 62: .Ar flags
! 63: of a file dictate special restrictions beyond those enforced by its
! 64: mode/permissions.
1.1 deraadt 65: .Pp
66: The options are as follows:
67: .Bl -tag -width Ds
1.7 ! aaron 68: .It Fl R
! 69: Recursively descend through any specified directory arguments.
! 70: Change the flags of the file hierarchies rooted
! 71: in the files instead of just the files themselves.
1.1 deraadt 72: .It Fl H
73: If the
74: .Fl R
1.7 ! aaron 75: option is also specified, symbolic links on the command line are followed.
1.1 deraadt 76: (Symbolic links encountered in the tree traversal are not followed.)
77: .It Fl L
78: If the
79: .Fl R
1.7 ! aaron 80: option is also specified, all symbolic links are followed.
1.1 deraadt 81: .It Fl P
82: If the
83: .Fl R
1.7 ! aaron 84: option is also specified, no symbolic links are followed.
1.1 deraadt 85: .El
86: .Pp
87: Flags are a comma separated list of keywords.
88: The following keywords are currently defined:
89: .Bd -literal -offset indent compact
90: arch set the archived flag
91: opaque set the opaque flag (owner or super-user only)
92: nodump set the nodump flag (owner or super-user only)
93: sappnd set the system append-only flag (super-user only)
94: schg set the system immutable flag (super-user only)
95: uappnd set the user append-only flag (owner or super-user only)
96: uchg set the user immutable flag (owner or super-user only)
97: .Ed
98: .Pp
99: Putting the letters
100: .Dq no
101: before an option causes the flag to be turned off.
102: For example:
103: .Bd -literal -offset indent compact
104: nouchg the immutable bit should be cleared
105: .Ed
106: .Pp
107: Symbolic links do not have flags, so unless the
108: .Fl H
109: or
110: .Fl L
111: option is set,
1.5 aaron 112: .Nm
1.1 deraadt 113: on a symbolic link always succeeds and has no effect.
114: The
115: .Fl H ,
116: .Fl L
117: and
118: .Fl P
119: options are ignored unless the
120: .Fl R
121: option is specified.
122: In addition, these options override each other and the
123: command's actions are determined by the last one specified.
1.6 deraadt 124: .Pp
125: Only the super-user can change the user flags on block and
126: character devices.
1.1 deraadt 127: .Pp
1.3 deraadt 128: You can use "ls -lo" to see the flags of existing files.
129: .Pp
1.1 deraadt 130: The
1.5 aaron 131: .Nm
1.4 aaron 132: utility exits 0 on success or >0 if an error occurred.
1.1 deraadt 133: .Sh SEE ALSO
1.3 deraadt 134: .Xr ls 1 ,
1.1 deraadt 135: .Xr chflags 2 ,
136: .Xr stat 2 ,
137: .Xr fts 3 ,
138: .Xr symlink 7