chflags -- change file flags
chflags [-fhv] [-R [-H | -L | -P]] flags file …
Modifies the file flags of the listed files as specified by the
| force, forge-ahead, i.e do not display a diagnostic message if chflags could not modify the flags for file, nor modify the exit status to reflect such failures.
| verbose, showing filenames as the flags are modified. Specify more
than once, to output the old and new flags of the file, in octal notation.
| If the file is a symbolic link, change the file flags of the link itself rather than the file to which it points.
| recurse, Change the file flags for the file hierarchies rooted in the files instead of just the files themselves.
the tree traversal are not followed.)
| with |
-R, symbolic links on the command line are followed. (Symbolic links encountered in
| with |
-R, all symbolic links are followed.
| with |
-R, Prevent symbolic links from being followed. This is the default.
The flags to set the flags are specified as an octal number or a comma separated list of keywords.
|archived (super-user only)
|(owner or super-user only). [Directory is opaque when viewed through a union mount]
|(owner or super-user only)
| system append-only (super-user only)
| user append-only (owner or super-user only)
| system immutable (super-user only)
| user immutable (owner or super-user only) |
Prevents even root from updating owner via
|hidden [Hide item from GUI]
schg flags may only be unset when the system is in single-user mode.
As discussed in chflags(2), as of Darwin Mountain Lion 11/5/12
no before or removing the letters
no from a keyword causes the flag to be cleared. For example:
| clear the user immutable flag (owner or super-user only)
|clear the nodump flag (owner or super-user only)
-L are given, chflags on a symbolic link always succeeds and has no effect.
options are ignored unless the
-R option is specified. In addition, these options override each other and the command's
actions are determined by the last one specified.
ls -lO to see the flags .
The chflags utility exits 0 on success, and >0 if an error occurs.
ls(1), chflags(2), stat(2), fts(3), symlink(7)
The chflags command first appeared in 4.4BSD.
Only a limited number of utilities are chflags aware. Some of these tools include ls(1), cp(1), find(1), install(1),
dump(8), and restore(8). In particular a tool which is not currently chflags aware is the pax(1) utility.