chmod #
Change file mode.
Format is:
$ chmod <notation> <file>
Can only be done by the owner or the superuser.
This can be implemented using octal notation or symbolic notation. I favor symbolic notation.
| Notation | Meaning |
|---|---|
| u | User |
| g | Group owner |
| o | Others |
| a | All (default when not specificed) |
These are modified using the folowing operators:
+- add permission-- remove permission=- all others are to be removed
Some common examples:
| Notation | Meaning |
|---|---|
| u+x | Add execution permission for owner |
| u-x | Remove execution permission for owner |
| +x | Add execution permission for everyone |
| o-rw | Others remove read and write permissions |