Home Explore Blog CI



man-pages

3rd chunk of `chmod.man`
70cbe7bf6c67023fb0d21d7ce22cf3eae1501e206644d8dc0000000100000c57
 match the user’s effective group ID or one of the user’s supplementary group IDs, unless the user has appropriate privileges.  Addi‐
       tional restrictions may cause the set‐user‐ID and set‐group‐ID bits of MODE or RFILE to be ignored.  This behavior depends on the policy and functionality of the underlying chmod system call.  When in doubt, check the
       underlying system behavior.

       For directories chmod preserves set‐user‐ID and set‐group‐ID bits unless you explicitly specify otherwise.  You can set or clear the bits with symbolic modes like u+s and g-s.  To clear these bits for directories with
       a numeric mode requires an additional leading zero like 00755, leading minus like -6000, or leading equals like =755.

RESTRICTED DELETION FLAG OR STICKY BIT
       The restricted deletion flag or sticky bit is a single bit, whose interpretation depends on the file type.  For directories, it prevents unprivileged users from removing or renaming a file in the directory unless they
       own the file or the directory; this is called the restricted deletion flag for the directory, and is commonly found on world‐writable directories like /tmp.  For regular files on some older systems, the bit saves  the
       program’s text image on the swap device so it will load more quickly when run; this is called the sticky bit.

OPTIONS
       Change the mode of each FILE to MODE.  With --reference, change the mode of each FILE to that of RFILE.

       -c, --changes
              like verbose but report only when a change is made

       -f, --silent, --quiet
              suppress most error messages

       -v, --verbose
              output a diagnostic for every file processed

       --no-preserve-root
              do not treat ’/’ specially (the default)

       --preserve-root
              fail to operate recursively on ’/’

       --reference=RFILE
              use RFILE’s mode instead of MODE values

       -R, --recursive
              change files and directories recursively

       --help display this help and exit

       --version
              output version information and exit

       Each MODE is of the form ’[ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=][0-7]+’.

AUTHOR
       Written by David MacKenzie and Jim Meyering.

REPORTING BUGS
       GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
       Report any translation bugs to <https://translationproject.org/team/>

COPYRIGHT
       Copyright © 2022 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
       This is free software: you are free to change and redistribute it.  There is NO WARRANTY, to the extent permitted by law.

SEE ALSO
       chmod(2)

       Full documentation <https://www.gnu.org/software/coreutils/chmod>
       or available locally via: info '(coreutils) chmod invocation'

GNU coreutils 9.1                                                                                         January 2024                                                                                                  CHMOD(1)

Title: chmod: Sticky Bit, Options, and Copyright Information
Summary
This section describes the restricted deletion flag (sticky bit), chmod command options, and copyright information. The sticky bit has different meanings for directories (restricting file deletion/renaming) and, on older systems, for regular files (saving the text image for faster loading). It then lists and explains the various options available for the chmod command, such as '-c', '-f', '-v', '--preserve-root', '--reference', '-R', '--help', and '--version'. Finally, it provides information about the author, bug reporting, copyright, and related documentation.