xref: /original-bsd/usr.bin/chflags/chflags.1 (revision e58c8952)
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.2 (Berkeley) 03/31/94
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.
57dump	set the dump flag
58sappnd	set the system append-only flag (super-user only)
59schg	set the system immutable flag (super-user only)
60uappnd	set the user append-only flag (owner or super-user only)
61uchg	set the user immutable flag (owner or super-user only)
62.Ed
63.Pp
64Putting the letters
65.Dq no
66before an option causes the flag to be turned off.
67For example:
68.Bd -literal -offset indent compact
69nodump	the file should never be dumped
70.Ed
71.Pp
72Symbolic links do not have flags, so unless the
73.Fl H
74or
75.Fl L
76option is set,
77.Nm chflags
78on a symbolic link always succeeds and has no effect.
79The
80.Fl H ,
81.Fl L
82and
83.Fl P
84options are ignored unless the
85.Fl R
86option is specified.
87In addition, these options override each other and the
88command's actions are determined by the last one specified.
89.Pp
90The
91.Nm chflags
92utility exits 0 on success, and >0 if an error occurs.
93.Sh SEE ALSO
94.Xr chflags 2 ,
95.Xr stat 2 ,
96.Xr fts 3 ,
97.Xr symlink 7
98