xref: /original-bsd/usr.bin/chflags/chflags.1 (revision a998a48a)
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.\" %sccs.include.redist.roff%
8.\"
9.\"	@(#)chflags.1	8.4 (Berkeley) 05/02/95
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
19.Oo
20.Fl R
21.Op Fl H | Fl L | Fl P
22.Oc
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
35.It Fl H
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.
48.It Fl R
49Change the file flags for the file hierarchies rooted
50in the files instead of just the files themselves.
51.El
52.Pp
53Flags are a comma separated list of keywords.
54The following keywords are currently defined:
55.Bd -literal -offset indent compact
56.\"arch	nothing yet.
57opaque	set the opaque flag (owner or super-user only)
58nodump	set the nodump flag (owner or super-user only)
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)
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
70nouchg	the immutable bit should be cleared
71.Ed
72.Pp
73Symbolic links do not have flags, so unless the
74.Fl H
75or
76.Fl L
77option is set,
78.Nm chflags
79on a symbolic link always succeeds and has no effect.
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.
90.Pp
91The
92.Nm chflags
93utility exits 0 on success, and >0 if an error occurs.
94.Sh SEE ALSO
95.Xr chflags 2 ,
96.Xr stat 2 ,
97.Xr fts 3 ,
98.Xr symlink 7
99