cheat sheets.

$ cheat chmod
chmod: a Unix utility for managing file permissions

Modes can be expressed in octal or human-readable:

                          Description | Octal  | Human-readable
    ----------------------------------+--------+---------------
                       Set user write | 200    | u=w
    Set user rwx, group and others rx | 755    | u=rwx,go=rx
                       Add group read | -      | g+w
                   Remove all execute | 111    | a-x
     Set user rws, everyone else none | 4700   | u=rwxs,go-rwx
                      Add user sticky | -      | u+s
                     Add group sticky | -      | g+s

Example: Make foo u=rwx and go=rx:
  $ chmod u=rwx,go=rx foo
  $ chmod 755 foo

Example: Find all directories, set them to 'mygroup' and make them group sticky:
  $ find . -type d -exec chgrp mygroup \{\} \;
  $ find . -type d -exec chmod g+s \{\} \;
Version 1, updated 802 days ago.
. o 0 ( | history | revert to | current | diff )
( add new | see all )