File:  [MW Coherent from dump] / coherent / a / usr / man / COHERENT / chmod.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:34 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent



chmod                        Command                        chmod




Change the modes of a file

cchhmmoodd +_m_o_d_e_s _f_i_l_e
cchhmmoodd -_m_o_d_e_s _f_i_l_e

The COHERENT  system assigns a mode to every  file, to govern how
users access  the file.  The mode grants  or denies permission to
read, write, or execute a file.

The mode grants permission separately  to the owner of a file, to
users  from the  owner's group,  and to all  other users.   For a
directory,  execute  permission grants  or  denies  the right  to
search the  directory, whereas write permission  grants or denies
the right to create and remove files.

In addition,  the mode contains  three bits that  perform special
tasks: the  set-user-id bit, the set-group-id  bit, and the save-
text or  ``sticky'' bit.  See the Lexicon  entry for the COHERENT
system call chmod for more information on how to use these bits.

The command chmod  changes the permissions of each specified file
according  to the  given mode  argument.  mode  may be  either an
octal number or a symbolic mode.  Only the owner of a file or the
superuser may  change a file's mode.  Only  the superuser may set
the sticky bit.

A symbolic  mode may have  the following form.   No spaces should
separate the fields in the actual mode specification.


             [_w_h_i_c_h] _h_o_w _p_e_r_m ... [, ...]


which specifies the permissions that are affected by the command.
It may consist of one or more of the following:


             aa       All permissions, equivalent to ggoouu
             gg       Group permissions
             oo       Other permissions
             uu       User permissions


If no which is given, a  is assumed and chmod uses the file crea-
tion mask, as described in umask.

how specifies how the permissions will be changed.  It can be


             =       Set permissions
             +       Add permissions
             -       Take away permissions




COHERENT Lexicon                                           Page 1




chmod                        Command                        chmod




perm specifies which  permissions are changed.  It may consist of
one or more of the following:


             gg       Current group permissions
             oo       Current other permissions
             rr       Read permission
             ss       Setuid upon execution
             tt       Save text (sticky bit)
             uu       Current user permissions
             ww       Write permission
             xx       Execute permission


Multiple _h_o_w/_p_e_r_m pairs have the same which applied to them.  One
or more  specifications separated by  commas tell chmod  to apply
each specification to the file successively.

The octal modes (see stat) are as follows:


         0044000000    Set user id upon execution
         0022000000    Set group id upon execution
         0011000000    Sticky bit (save text)
         0000440000    Owner read permission
         0000220000    Owner write permission
         0000110000    Owner execute permission
         0000004400    Group read permission
         0000002200    Group write permission
         0000001100    Group execute permission
         0000000044    Others read permission
         0000000022    Others write permission
         0000000011    Others execute permission


An octal mode argument to  chmod is obtained by oring the desired
mode bits together.

***** Examples *****

The first  example below sets  the owner's permissions  to read +
write +  execute, and the  group and other permissions  to read +
execute.   The   second  example  adds   execute  permission  for
everyone.


    chmod u=rwx,go=rx file
    chmod +x file


***** See Also *****

chgrp, chown, commands, ls, stat, umask



COHERENT Lexicon                                           Page 2



unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.