Name
chmod
Synopsis
chmod [option]modefiles
Changes the
access
mode 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
-
-f Suppress error message upon failure to change a file’s mode.
-
-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
-Roption.-
-L Follow all symbolic links during recursive operation. Works only with the
-Roption.-
-P Follow no symbolic links during recursive operation. Works only with the
-Roption (the default).-
-R Recursively descend directory arguments while setting modes.
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 Sets the execute bit for all who values if any of the execute bits are already set in the specified file; meaningful only in conjunction with the op symbol +
-
s Set user (or group) ID
-
t Sticky bit; save text mode (file) or prevent removal of files by nonowners (directory)
-
u User’s present permission
-
g Group’s present permission
-
o Other’s present permission
Alternatively, specify permissions by a 3-digit sequence. The first digit designates owner permission; the second, group permission; ...