Name
chmod
Synopsis
chmod [options] mode
files
chmod [options] --reference=
filename
files
Change the access mode (permissions) of one or more files. Only the owner of a file or a privileged user may change the mode. mode can be numeric or an expression in the form of who opcode permission. who is optional (if omitted, default is a); choose only one opcode. Multiple modes are separated by commas.
Options
- -c, --changes
Print information about files that are changed.
- -f, --silent, --quiet
Do not notify user of files that chmod cannot change.
- --help
Print help message and then exit.
- -R, --recursive
Traverse subdirectories recursively, applying changes.
- --reference= filename
Change permissions to match those associated with filename.
- -v, --verbose
Print information about each file, whether changed or not.
- --version
Print version information and then exit.
Who
- u
User.
- g
Group.
- o
Other.
- a
All (default).
Opcode
- +
Add permission.
- -
Remove permission.
- =
Assign permission (and remove permission of the unspecified fields).
Permissions
- r
Read.
- w
Write.
- x
Execute.
- s
Set user (or group) ID.
- t
Sticky bit; used on directories to prevent removal of files by non-owners.
- u
User’s present permission.
- g
Group’s present permission.
- o
Other’s present permission.
Alternatively, specify permissions by a three-digit octal number. The first digit designates owner permission; the second, group permission; and the third, other’s permission. Permissions are calculated by adding the following octal values:
- 4
Read. ...
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.
Read now
Unlock full access