chmod(1) MPE/iX Shell and Utilities chmod(1)
______________________________________________________________________
NAME
chmod -- change access permissions of a file
SYNOPSIS
chmod [-fR] mode pathname
DESCRIPTION
chmod changes the access permissions or modes of the specified
files or directories. Modes determine who can read, change or
execute a file.
Options
chmod accepts the following options:
-f Does not issue error messages concerning file access permis-
sions, even if chmod encounters such errors.
-R If you specify a directory as a path name on the command,
chmod changes the access permissions of all files and sub-
directories under that directory.
Modes
You can specify the mode value on the command line in either sym-
bolic form or as an octal value.
A symbolic mode has the form
[who] op permission [op permission ...]
The who value is any combination of the following:
u Sets user (individual) permissions.
g Sets group permissions.
o Sets other permissions.
a Sets all permissions; this is the default.
The op part of a symbolic mode is an operator that tells chmod to
turn the permissions on or off. The possible values are:
+ Turns on a permission.
- Turns off a permission.
= Turns on the specified permissions and turns off all others.
The permission part of a symbolic mode is any combination of the
following:
r Read permission. If this is off, you cannot read the file.
x Execute permission. If this is off, you cannot execute the
file.
X Execute/search permission for a directory; or execute permis-
sion for a file only when the current mode has at least one
1
chmod(1) MPE/iX Shell and Utilities chmod(1)
______________________________________________________________________
of the execute bits set.
w Write permission. If this is off, you cannot write to the
file.
s On POSIX-compliant and UNIX systems, this stands for setuid
on execution or setgid on execution permission.
t On UNIX systems, this stands for the sticky bit.
You can specify multiple symbolic modes if you separate them with
commas.
Absolute modes are octal numbers specifying the complete list of
attributes for the files; you specify attributes by OR'ing
together these bits.
4000 Setuid bit
2000 Setgid bit
1000 Sticky bit
0400 Individual read
0200 Individual write
0100 Individual execute (or list directory)
0040 Group read
0020 Group write
0010 Group execute
0004 Other read
0002 Other write
0001 Other execute
EXAMPLES
chmod -w nowrite
makes file nowrite read-only.
chmod a=rwx file
turns on read, write, and execute permissions, and turns off the
setuid and sticky bit attributes. This is equivalent to
chmod 0777 file
2
chmod(1) MPE/iX Shell and Utilities chmod(1)
______________________________________________________________________
DIAGNOSTICS
Possible exit status values are:
0 Successful completion.
1 Failure due to any of the following:
-- unable to access a specified file
-- unable to change the modes on a specified file
-- unable to read the directory containing item to change
-- encountered a fatal error when using the -R option
2 Failure due to any of the following:
-- missing or invalid mode argument
-- too few arguments.
Messages
Message: fatal error during "-R" option
Cause: You specified the -R option but some file or directory
in the directory structure was inaccessible.
Action: Check all files in the directory structure to make sure
that you have access to them.
Message: file "filename": system error
Cause: See syserror(3).
Action: See syserror(3).
Message: Insufficient memory
Cause: There were not enough free system resources to perform
the specified operation.
Action: Free up more resources.
Message: Missing mode argument.
Cause: You did not specify an argument represent the new
access permissions.
Action: Provide the missing argument.
Message: read directory "pathname": system error
Cause: See syserror(3).
Action: See syserror(3).
Message: stat file "filename": system error
Cause: See syserror(3).
Action: See syserror(3).
3
chmod(1) MPE/iX Shell and Utilities chmod(1)
______________________________________________________________________
Message: Unknown or missing operator in symbolic mode "mode-
string"
Cause: When using the symbolic mode to indicate new access
permissions, you specified a string modestring which
was either missing an operator or contained an operator
that chmod does not recognize.
Action: Make sure that all mode values in symbolic mode contain
one of the following operators: +, -, or =.
Message: Octal mode may contain only digits [0-7] in numstring
Cause: When using the octal mode to indicate new access per-
missions, you specified a string numstring which con-
tained a character other than the digits 0 to 7.
Action: Make sure that all mode values in octal mode are valid
octal numbers, containing only the digits 0 through 7.
PORTABILITY
POSIX.2. x/OPEN Portability Guide 4.0.
The -f option and the t permission are extensions to the POSIX
standard.
MPE/iX NOTES
The current MPE/iX implementation of chmod does not allow you to
modify the access permissions of the root directory, account
directories, and group directories. Also, use of the sticky bits
is not allowed.
On MPE/iX, chmod is available as both a built-in shell utility
and an external utility.
For more information on how the current MPE/iX implementation may
affect the operation of this utility, see Appendix A, MPE/iX
Implementation Considerations.
SEE ALSO
lc(1), ls(1), umask(1)
4