chmodchmod
[option
] mode
files
Change 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 OptionsWho
Opcode
Permission
Alternatively, specify permissions by a three-digit sequence. The first digit designates owner permission; the second, group permission; and the third, others permission. Permissions are calculated by adding the following octal values:
Note: a fourth digit may precede this sequence. This digit assigns the following modes:
ExamplesAdd execute-by-user permission to file :
Either of the following assigns read-write-execute permission by owner (7), read-execute permission by group (5), and execute-only permission by others (1) to file :
Any one of the following assigns read-only permission to file for everyone:
Set the user ID, assign read-write-execute permission by owner, and assign read-execute permission by group and others:
|
|