SCCS-vsn: usr.bin/chflags/chflags.1 5.2
.\"
.\" %sccs.include.redist.roff%
.\"
.\"
.\" %sccs.include.redist.roff%
.\"
-.\" @(#)chflags.1 5.1 (Berkeley) %G%
+.\" @(#)chflags.1 5.2 (Berkeley) %G%
.Nd change file flags
.Sh SYNOPSIS
.Nm chflags
.Nd change file flags
.Sh SYNOPSIS
.Nm chflags
.Ar flags
.Ar file ...
.Sh DESCRIPTION
.Ar flags
.Ar file ...
.Sh DESCRIPTION
.Pp
The options are as follows:
.Bl -tag -width Ds
.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 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.
-Symbolic links are not indirected through, nor are their flags altered.
+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.
.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.