Open System Services Shell and Utilities Reference Manual (G06.27+, H06.04+)
User Commands (c) chmod(1)
Valid options for the operation argument are as follows:
- Removes specified permissions.
+ Adds specified permissions.
= Clears the selected permission field and sets it to the specified code. If you do not
specify a permission code following =, the chmod command removes all permissions
from the selected field.
Valid options for the permission argument are as follows:
r Read permission.
w Write permission.
x Execute permission for files, search permission for directories.
X Execute permission only if file is a directory or if at least one execute bit (S_IXUSR,
S_IXGRP,orS_IXOTH) is set.
s Set-user-ID or set-group-ID permission.
This permission bit sets the effective user ID or group ID to that of the owner or group
owner of file whenever the file is run. Use this permission setting with the u or g option
to allow temporary or restricted access to files not normally accessible to other users.
An s appears in the user or group execute position of a long listing (see the reference
page for the ls command) to show that the file runs with set-user-ID or set-group-ID
permission.
Note that the command chmod o+s has no effect (the set-user-ID-on-execution and
set-group-ID-on-execution bits are not modified).
t Save text permission.
In some versions of the UNIX system, setting this permission bit causes the text seg-
ment of a program to remain in virtual memory after its first use. Such systems there-
fore do not transfer the program code of frequently accessed programs into the paging
area.
You can specify this permission for OSS files, but it has no effect. The letter t appears
in the execute position of the all others option to indicate that the file has this bit (the
sticky bit) set.
If a directory has this bit set, then deletion in it is restricted. An entry in a sticky direc-
tory can be removed or renamed by a user only if the user has write permission for the
directory and the user is the owner of the file, the owner of the directory, or has
appropriate permissions.
The u, g, and o options indicate that permission is to be taken from the current mode. Omitting
permission is useful only with = to remove all permissions. For example, entering the following
command clears all permission fields for the user and resets them all to those of the group for
file1:
u=g file1
All permission bits not explicitly specified are cleared.
You can specify multiple symbolic modes, separated with commas. Do not separate items in this
list with spaces. Operations are performed in the order they appear from left to right.
527188-004 Hewlett-Packard Company 2−41