.\" 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.6 (Berkeley) 05/30/93 .\" .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 Flags are a comma separated list of keywords. The following keywords are currently defined: .Bd -literal -offset indent compact .\"arch nothing yet. dump set the dump flag sappnd set the system append-only flag (super-user only) schg set the system immutable flag (super-user only) uappnd set the user append-only flag (owner or super-user only) uchg set the user immutable flag (owner or super-user only) .Ed .Pp Putting the letters .Dq no before an option causes the flag to be turned off. For example: .Bd -literal -offset indent compact nodump the file should never be dumped .Ed .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 always succeeds and has no effect. .Pp The .Nm chflags utility exits 0 on success, and >0 if an error occurs. .Sh SEE ALSO .Xr chflags 2 , .Xr stat 2 , .Xr fts 3 , .Xr symlink 7