Skip to Content
Mac OS X in a Nutshell
book

Mac OS X in a Nutshell

by Jason McIntosh, Chuck Toporek, Chris Stone
January 2003
Intermediate to advanced
832 pages
32h 40m
English
O'Reilly Media, Inc.
Content preview from Mac OS X in a Nutshell

Name

chflags

Synopsis

chflags [options] flags files
                  

Changes the file flags of one or more files. flags is a comma-separated list of file flags, described below. To unset a flag, use the same command but with no added to the front of the flag’s name. To view a file’s current flags, use the ls -lo command.

Options

-H

If any of the pathnames given in the command line are symbolic links, follow only those links during recursive operation. Works only with the -R option.

-L

Follow all symbolic links during recursive operation. Works only with the -R option.

-P

Follow no symbolic links during recursive operation. Works only with the -R option (the default).

-R

Recursively descend through the directory, including subdirectories and symbolic links, changing the specified file flags as it proceeds.

Flags

Flag name

Flag set

Who can change

arch

archived

Superuser only

opaque

opaque

Owner or superuser only

nodump

nodump

Owner or superuser only

sappend

system append-only

Superuser only

schg

system immutable

Superuser only

uappend

user append-only

Owner or superuser only

uchg

user immutable

Owner or superuser only

Though the system append-only (sappend) and system immutable (schg) flags can be set by the superuser in normal system mode, you can only unset them while in single-user mode.

Examples

Setting the user immutable (uchg) flag for a file prevents it from being deleted, changed, or moved. By locking a file in the Finder, you’re actually setting its user ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mac OS X Internals: A Systems Approach

Mac OS X Internals: A Systems Approach

Amit Singh
C++ In a Nutshell

C++ In a Nutshell

Ray Lischner
Linux Shell Scripting Cookbook - Third Edition

Linux Shell Scripting Cookbook - Third Edition

Clif Flynt, Sarath Lakshman, Shantanu Tushar
Optimized C++

Optimized C++

Kurt Guntheroth

Publisher Resources

ISBN: 0596003706Supplemental ContentCatalog PageErrata