1.\" Copyright (c) 1989, 1990, 1993 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.1 (Berkeley) 06/29/93 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.Op Fl HRh 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 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. 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. 41.It Fl h 42When encountering a symbolic link anywhere in the traversal, follow it. 43.El 44.Pp 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 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) 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 64The flags of a symbolic link are immutable, so unless the 65.Fl h 66or 67.Fl H 68flag is set, 69.Nm chflags 70on a symbolic link always succeeds and has no effect. 71.Pp 72The 73.Nm chflags 74utility exits 0 on success, and >0 if an error occurs. 75.Sh SEE ALSO 76.Xr chflags 2 , 77.Xr stat 2 , 78.Xr fts 3 , 79.Xr symlink 7 80