chmod | [-option] | [ugoa] | [+-=] | [rwx] | [st] | [file directroy] |
-c →Report changes -R →Report changes -v → Verbosely report the process |
u →user g →group o →other a →all |
+ →increase permission - →subtract permission = →directly set permission |
r → read permission w → write permission x → excute permission |
s →suid or sgid t →sticky bit |
ile or directory |
For example, to add write permission to the group of a file, you can use chmod g+w FILE. Also, chmod -v ug=rw,o+r FILE means giving the user and group read and write permissions, and others read permissions (resulting in "rw-rw-r--" permissions).
For more examples and explanations of symbolic notation with chmod, please refer to the provided link.
0 → --- 1 → --x 2 → -w- 3 → -wx 4 → r-- 5 → r-x 6 → rw- 7 → rwx
For instance, using chmod 543 FILE would set the permissions of the file to "r-w r-- -wx" (matching the table).
For more examples and explanations of numeric notation with chmod, please refer to the provided link.