Name

chmod

Synopsis

chmod [option] mode files

Changes the access mode or access control lists (ACLs) of one or more files. Only the owner of a file or a privileged user may change its mode. Create mode by concatenating the characters from who, opcode, and permission. who is optional (if omitted, default is a); choose only one opcode.

Options

+a entry

Add ACL entry entry for the file.

+a pos entry

Add ACL entry entry for the file at position pos.

-a entry

Remove ACL entry entry for the file.

=a pos entry

Rewrites the entry at position pos with entry.

-f

Suppress error message upon failure to change a file’s mode.

-h

Change the permissions of the link, rather than the referent.

-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 directory arguments while setting modes.

-v

Verbose output, showing files as they are changed. If -v appears more than once, the old and new permissions are shown as well.

Who

u

User.

g

Group.

o

Other.

a

All (default).

Opcode

+

Add permission.

-

Remove permission.

=

Assign permission (and remove permission of the unspecified fields).

Permission

r

Read.

w

Write.

x

Execute (file) or search (directory).

X

Set the execute bit for all who values if any of ...

Get Mac OS X Tiger in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.