chmod.1 (2010 09)

c
chmod(1) chmod(1)
+ Add permission to the existing file mode bits of who.
- Delete permission from the existing file mode bits of who.
= Replace the existing mode bits of who with permission .
permission One or more of the following letters:
r Add or delete the read permission for who.
w Add or delete the write permission for who.
x Add or delete the execute file (search directory) permission for who.
s Add or delete the set-owner-ID-on-file-execution or set-group-ID-on-file-
execution permission for who. Useful only if
u or g is expressed or implied
in who.
t Add or delete the sticky bit permission. Useful only if
u is expressed or
implied in who. See chmod(2).
X Conditionally add or delete the execute/search permission as follows:
If file is a directory, add or delete the search permission to the existing
file mode for who. (Same as
x.)
If file is not a directory, and the current file permissions include the exe-
cute permission (
ls -l displays an
x or an s) for at least one of user,
group, or other, then add or delete the execute file permission for who.
If file is not a directory, and no execute permissions are set in the current
file mode, then do not change any execute permission.
Or one only of the following letters:
u Copy the current user permissions to who.
g Copy the current group permissions to who.
o Copy the current other permissions to who.
The operations are performed in the order specified, and can override preceding operations specified in
the same command line.
If who is omitted, the
r, w, x, and X permissions are changed for all users if the changes are permitted by
the current file mode creation mask (see umask(1)). The s and t permissions are changed as if
a was
specified in who.
Omitting permission is useful only when used with
= to delete all permissions.
Numeric Mode (Obsolescent)
Absolute permissions can be set by specifying a numeric_mode , an octal number constructed from the log-
ical OR (sum) of the following mode bits:
Miscellaneous mode bits:
4000 (= u=s) Set user ID on file execution (file only)
2000 (= g=s) Set group ID on file execution (file only)
1000 (= u=t) Set sticky bit; see below and chmod(2)
Permission mode bits:
0400 (= u=r) Read by owner
0200 (= u=w) Write by owner
0100 (= u=x) Execute (search in directory) by owner
0040 (= g=r) Read by group
0020 (= g=w) Write by group
0010 (= g=x) Execute/search by group
0004 (= o=r) Read by others
0002 (= o=w) Write by others
0001 (= o=x) Execute/search by others
EXTERNAL INFLUENCES
Environment Variables
LC_MESSAGES determines the language in which messages are displayed.
If
LC_MESSAGES is not specified or is null, it defaults to the value of LANG.IfLANG is not specified or is
null, it defaults to C (see lang (5)).
If any internationalization variable contains an invalid setting, all internationalization variables default
to
C. See environ (5).
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010