change file flags
chflags [-fhv] [-R [-H | -L | -P]] [no]flags file …
archived, opaque, nodump, sappend, uappend, simmutable, uimmutable and hidden flags.
| 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. |
than once, old and new flags are output in numeric notation.
| recurse, Change the flags for the file hierarchies rooted in the files instead of just the files themselves.
| symbolic link: change the file flags of the link itself not than the file to which it points.
| symbolic links on the command line are followed. (Symbolic links encountered in the tree traversal are not followed.)
| all symbolic links are followed.
| Prevent symbolic links from being followed. default.
To set the flags specify a numeric or a comma separated list of keywords.
|archived (super-user only)
|. [Directory is opaque when viewed through a union mount]
| system append-only (super-user only)
| user append-only
| system immutable (super-user only) |
makes the file/folder Locked/Protected and is equivalent to locking the file in Finder's Show Info box.
| user immutable |
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 prefix causes the flag to be cleared. For example:
| clear the user immutable flag
|clear the nodump flag
chflags -v -v nouchg DSCN0608.JPG
DSCN0608.JPG: 02 -> 00
-L are given, chflags on a symbolic link always succeeds and has no effect.
options are ignored unless
-R is specified, override each other and the actions are determined by the last one specified.
ls -lO† to see the flags .
-rwxrwxrwx 1 dgerman staff - 7888853 Feb 17 09:21 DSCN0672.JPG*
-rwxrwxrwx 1 dgerman staff uchg 8209104 Feb 17 09:21 DSCN0673.JPG*
-rwxrwxrwx@ 1 dgerman staff - 3575147 Mar 11 17:59 DSCN0675.JPG
1: invalid flags or No such file or directory
ls, chflags, stat, fts, symlink
Only a limited number of utilities are chflags aware. These include ls, cp, find, install,
dump and restore. In particular pax( a backup utility) is NOT aware .