4.4BSD snapshot (revision 8.1); add 1993 to copyright
[unix-history] / usr / src / usr.bin / chflags / chflags.1
CommitLineData
dc986658
KM
1.\" Copyright (c) 1989, 1990 The Regents of the University of California.
2.\" 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.\"
13de2e6a 9.\" @(#)chflags.1 8.1 (Berkeley) %G%
dc986658
KM
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
74ee26c2 19.Op Fl HRh
dc986658
KM
20.Ar flags
21.Ar file ...
22.Sh DESCRIPTION
23The
24.Nm chflags
25utility modifies the file flags of the listed files
26as specified by the
27.Ar flags
28operand.
29.Pp
30The options are as follows:
31.Bl -tag -width Ds
74ee26c2
EA
32.It Fl H
33When encountering a symbolic link on the command line, follow it. All other
34symbolic links encountered in the traversal are not followed.
dc986658
KM
35.It Fl R
36Traverse a file hierarchy.
37For each file that is of type directory,
38.Nm chflags
39changes the flags of all files in the file hierarchy below it followed
40by the flags of the directory itself.
74ee26c2
EA
41.It Fl h
42When encountering a symbolic link anywhere in the traversal, follow it.
dc986658
KM
43.El
44.Pp
8a499f2f
KB
45Flags are a comma separated list of keywords.
46The following keywords are currently defined:
47.Bd -literal -offset indent compact
48.\"arch nothing yet.
49dump set the dump flag
b0a4b439
KM
50sappnd set the system append-only flag (super-user only)
51schg set the system immutable flag (super-user only)
52uappnd set the user append-only flag (owner or super-user only)
53uchg set the user immutable flag (owner or super-user only)
8a499f2f
KB
54.Ed
55.Pp
56Putting the letters
57.Dq no
58before an option causes the flag to be turned off.
59For example:
60.Bd -literal -offset indent compact
61nodump the file should never be dumped
62.Ed
63.Pp
74ee26c2
EA
64The flags of a symbolic link are immutable, so that unless the
65.Fl h
66or
67.Fl H
68flags are set,
69.Nm chflags
8a499f2f 70on a symbolic link always succeeds and has no effect.
dc986658
KM
71.Pp
72The
73.Nm chflags
74utility exits 0 on success, and >0 if an error occurs.
dc986658
KM
75.Sh SEE ALSO
76.Xr chflags 2 ,
77.Xr stat 2 ,
0d17b9a2
KB
78.Xr fts 3 ,
79.Xr symlink 7