Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)
User Commands (c) chmod(1)
NAME
chmod - Changes permissions and other file mode settings
SYNOPSIS
chmod [-fR] absolute_mode file ...
chmod [ -W NOG ][-W NOE ][-fhR][who] +permission ... | -permission ... | =permis- |
sion ... file ...
FLAGS
-f Does not report an error if the chmod command fails to change the mode on a file.
-h Changes the mode of a symbolic link, instead of the file to which the symbolic link |
points. When you use this flag, the chmod command does not affect the file pointed to |
by the symbolic link. If you use -R flag with this flag, recursion does not take place.
-R Causes chmod to descend recursively through its directory arguments, setting the
mode for each file as described in Symbolic Mode and Absolute Mode in the
DESCRIPTION section. If chmod is unable to change the mode of a particular file,
or unable to read or search a particular directory, it continues processing through the
hierarchy. When symbolic links are encountered and the -h flag is not used, the mode |
of the parent file or directory changes, but the mode of linked files or directories does |
not change. If the -h flag is used with this flag, recursion does not take place.
HP Extensions
-W NOG Specifies that the /G directory should be omitted when the initial directory is root
and the recursive flag (-R) is used. This flag is ignored when the initial directory
is not /, /E,or/E/system or when recursion does not occur.
-W NOE Specifies that the /E directory should be omitted when the initial directory is root
and the recursive flag (-R) is used. This flag is ignored when the initial directory
is not root or when recursion does not occur.
Specify both the -W NOG and -W NOE flags to omit both the /G and /E directories.
DESCRIPTION
You can use either symbolic mode or absolute mode to specify the desired permission settings.
Symbolic mode is more portable but does not offer all of the options of absolute mode.
To change the file access permissions of a file or directory, the effective user ID of the process |
must match the super ID or the owner of the file, or the effective user ID of the process or one of |
its group affiliations must qualify it for membership in the Safeguard SECURITY-OSS- |
ADMINISTRATOR group. |
If chmod is invoked by a process whose effective user ID does not equal the super ID or file |
owner, the set-user-ID and set-group-ID bits of the file mode (04000 and 02000, respectively) are |
cleared.
Access Control Lists (ACLs)
When you execute the chmod command, you can change the effective permissions granted by |
optional entries in the ACL for a file. In particular, using the chmod command to remove read, |
write, and execute permissions from a file owner, owning group, and all others works as |
expected, because the chmod command affects the class entry in the ACL, limiting any access |
that can be granted to additional users or groups through optional ACL entries. To verify the |
effect, use getacl command on the file after the chmod command completes and note that all |
optional (nondefault) ACL entries with nonzero permissions also have the comment |
# effective:---. |
527188-007 Hewlett-Packard Company 2−41