HP-UX Reference (11i v3 07/02) - 1 User Commands A-M (vol 1)

c
chmod(1) chmod(1)
NAME
chmod - change file mode access permissions
SYNOPSIS
/usr/bin/chmod
[-A][-R] symbolic_mode_list file ...
Obsolescent form
/usr/bin/chmod
[-A][-R] numeric_mode file ...
DESCRIPTION
The
chmod command changes the permissions of one or more files according to the value of
symbolic_mode_list or numeric_mode. You can display the current permissions for a file with the
ls -l
command (see ls(1)).
Only the owner of a file, or a user with appropriate privileges, can change its mode.
Only a user having appropriate privileges can set (or retain, if previously set) the sticky bit of a regular file.
If the sticky bit is set on a directory, files inside the directory may be renamed or removed only by the
owner of the file, the owner of the directory, or the superuser (even if the modes of the directory would oth-
erwise allow such an operation).
In order to set the set-group-ID bit, the group of the file must correspond to your current group ID.
If chmod is used on a symbolic link, the mode of the file referred to by the link is changed.
Options
The chmod command recognizes the following options:
-A Preserve any optional access control list (ACL) entries associated with the file (HFS file systems
only). By default, in conformance with the IEEE Standard POSIX 1003.1-1988, optional HFS
ACL entries are deleted. For JFS ACLs, this option has no effect, because optional JFS ACL
entries are always preserved. For information about access control lists, see acl(5) and aclv(5).
-R Recursively change the file mode bits. For each file operand that names a directory,
chmod
alters the file mode bits of the named directory and all files and subdirectories in the file hierar-
chy below it.
Operands
The chmod command recognizes the following operands:
file Targe file for which the permissions are changes.
numeric-mode
Numeric value used to determine permission on a specified file. See the Numeric Mode section
for more information.
symbolic-mode-list
List of operations used to determine permissions on a specified file. See the Symbolic Mode List
section for more information.
Symbolic Mode List
A symbolic_mode_list is a comma-separated list of operations in the following form. Whitespace is not per-
mitted.
[who]op[permission][
,...]
The variable fields can have the following values:
who One or more of the following letters:
u Modify permissions for user (owner).
g Modify permissions for group.
o Modify permissions for others.
a Modify permissions for all users (a is equivalent to ugo).
op Required; one of the following symbols:
+ Add permission to the existing file mode bits of who.
128 Hewlett-Packard Company 1 HP-UX 11i Version 3: February 2007