Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ls(1)

chmod(2)

CHMOD(1)                             SysV                             CHMOD(1)



NAME
     chmod - change mode

SYNOPSIS
     chmod mode file ...

     chmod mode directory ...

DESCRIPTION
     chmod allows the permissions of the named files or directories to be
     changed according to mode, which may be absolute or symbolic.  An
     absolute mode is an octal number constructed from the OR of the following
     modes:

          4000      set user ID on execution
          20#0      set group ID on execution if # is 7, 5, 3, or 1
                    enable mandatory locking if # is 6, 4, 2, or 0
          1000      sticky bit (sticky bit is not supported in SysV)
          0400      read by owner
          0200      write by owner
          0100      execute (search in directory) by owner
          0070      read, write, execute (search) by group
          0007      read, write, execute (search) by others

     Symbolic changes are stated using letters that correspond both to access
     classes and to the individual permissions themselves.  Permissions to a
     file may vary depending on your user identification number (UID) or group
     identification number (GID).  Permissions are described in three
     sequences each having three characters:

          User   Group   Other

          rwx    rwx     rwx

     In this example, user, group, and others all have reading, writing, and
     execution permission to a given file.  There are two categories for
     granting permissions:  the access class (who) and the permissions
     themselves.  Thus, to change the mode of a file's (or directory's)
     permissions using chmod's symbolic method, use the following syntax:

                      [ who ] operator [ permission(s) ], ...

     A command line using the symbolic method would appear as follows:
                                  chmod g+rw file

     This command would make file readable and writable by the group.

     who is a combination of the letters u for owner's permissions), g
     (group), and o (other).  The letter a stands for ugo, the default if who
     is omitted.

     Operator can be plus (+) to add permission to the file's mode, minus (-)
     to take away permission, or equal (=) to assign permission absolutely
     (reset all other bits).

     Permission is any compatible combination of the following letters:
          r         reading permission
          w         writing permission
          x         execution permission
          s         user or group set-ID is turned on
          t         sticky bit (sticky bit is not supported in SysV)
          l         mandatory locking will occur during access

     Multiple symbolic modes separated by commas can be given, though no
     spaces may appear between these modes.  Operations are performed in the
     order given.  Multiple symbolic letters following a single operator cause
     the corresponding operations to be performed simultaneously.  The letter
     s is only useful with u or g, and t only works with u.

EXAMPLES
          chmod a-x file

          chmod 444 file

     The first examples deny execution permission to all.  The absolute
     (octal) example permits only reading permissions.

          chmod go+rw file

          chmod 606 file

     These examples make a file readable and writable by the group and others.

          chmod +l file

     This causes a file to be locked during access.

          chmod =rwx,g+s file

          chmod 2777 file

     These last two examples enable all to read, write, and execute the file;
     and they turn on the set group-ID.

SEE ALSO
     ls(1).
     chmod(2) in the SysV Programmer's Reference.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026