O'Reilly logo

Mac OS X Tiger in a Nutshell by Jason McIntosh, Chuck Toporek, Chris Stone, Andy Lester

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required