Added -Hh flags.
[unix-history] / usr / src / usr.bin / chflags / chflags.1
.\" Copyright (c) 1989, 1990 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" the Institute of Electrical and Electronics Engineers, Inc.
.\"
.\" %sccs.include.redist.roff%
.\"
.\" @(#)chflags.1 5.2 (Berkeley) %G%
.\"
.Dd
.Dt CHFLAGS 1
.Os
.Sh NAME
.Nm chflags
.Nd change file flags
.Sh SYNOPSIS
.Nm chflags
.Op Fl HRh
.Ar flags
.Ar file ...
.Sh DESCRIPTION
The
.Nm chflags
utility modifies the file flags of the listed files
as specified by the
.Ar flags
operand.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl H
When encountering a symbolic link on the command line, follow it. All other
symbolic links encountered in the traversal are not followed.
.It Fl R
Traverse a file hierarchy.
For each file that is of type directory,
.Nm chflags
changes the flags of all files in the file hierarchy below it followed
by the flags of the directory itself.
.It Fl h
When encountering a symbolic link anywhere in the traversal, follow it.
.El
.Pp
The flags of a symbolic link are immutable, so that unless the
.Fl h
or
.Fl H
flags are set,
.Nm chflags
on a symbolic link is a no-op.
.Pp
Only the owner of a file or the super-user is permitted to change
the low 16-bits in the flags of a file.
Only the the super-user is permitted to change
the high 16-bits in the flags of a file.
.Pp
The
.Nm chflags
utility exits 0 on success, and >0 if an error occurs.
.Sh FLAGS
Flags may be absolute or symbolic.
An absolute flag is an octal number constructed by
.Ar or'ing
the following values:
.Pp
.Bl -tag -width 6n -compact -offset indent
.It Li 1
the file should never be dumped
.El
.Pp
The symbolic flags is a comma separated list of keywords.
The following keywords are defined:
.Bd -literal -offset indent
dump cause the file to be dumped when it is next modified
.Ed
.Pp
Putting the word ``no'' before an option causes it to be deleted.
For example:
.Bd -literal -offset indent
nodump the file should never be dumped
.Ed
.Sh SEE ALSO
.Xr chflags 2 ,
.Xr stat 2 ,
.Xr fts 3