chmod
chmod
"change file mode bits" - chmod(1) - Linux man page
chmodis a Linux utility to broadly manage folder permissions.- Permissions are managed by summing four octal digits representing specific levels of access, with the final number representing the permissions for the entity
- 0 = none
- 1 = execute (x)
- 2 = write (w)
- 4 = read (r)
- The position of the summed octal digit represents dictates who is getting the permission
- First position: The object user (owner)
- Second position: The group
- Third position: All others
- The files "user" and "group" are set with chown
- A file may only have one user and one group assigned to it.
- Permissions are managed by summing four octal digits representing specific levels of access, with the final number representing the permissions for the entity
- Permissions can be set all at once or piece-meal
chmod 750 plans.txtwould set the permissions forplans.txtto User with RWX, Group with R-X, and Others with no access (---).chmod o+r plans.txtgrants "all others" Read access to the fileplans.txt.
chmodis not as fine-grained as setfacl, which allows the configuration of Access Control Lists (ACLs)
| Octal Digit | Permissions | 3-Character Display |
|---|---|---|
| 7 | read, write, execute | rwx |
| 6 | read, write | rw- |
| 5 | read, execute | r-x |
| 4 | read | r-- |
| 3 | write, execute | -wx |
| 2 | write | -w- |
| 1 | execute | --x |
| 0 | (none) | --- |
| Source: chmod |
Metadata
Sources
chmod
chmod(1): change file mode bits - Linux man page