c

chmod(1)

chmod(1)

NAME

chmod - change ®le mode access permissions

SYNOPSIS

/usr/bin/chmod [-A][-R]symbolic_mode_list ®le ...

Obsolescent form:

/usr/bin/chmod [-A][-R]numeric_mode ®le ...

DESCRIPTION

The chmod command changes the permissions of one or more ®les according to the value of symbolic_mode_list or numeric_mode. You can display the current permissions for a ®le with the ls -lcommand (see ls(1)).

Symbolic Mode List

Asymbolic_mode_list is a comma-separated list of operations in the following form. Whitespace is not per- mitted.

[who]op[permission] [,...]

The variable ®elds can have the following values:

who

One or more of the following letters:

uModify 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 ®le mode bits of who.

-Delete permission from the existing ®le mode bits of who. = Replace the existing mode bits of who with permission.

permission One or more of the following letters:

rAdd or delete the read permission for who.

wAdd or delete the write permission for who.

xAdd or delete the execute ®le (search directory) permission for who.

sAdd or delete the set-owner-ID-on-®le-execution or set-group-ID-on-®le- execution permission for who. Useful only if u or g is expressed or implied in who.

tAdd or delete the save-text-image-on-®le-execution (sticky bit) permission. Useful only if u is expressed or implied in who. See chmod(2).

XConditionally add or delete the execute/search permission as follows:

If ®le is a directory, add or delete the search permission to the existing ®le mode for who. (Same as x.)

If ®le is not a directory, and the current ®le permissions include the execute permission (ls -ldisplays an x or an s) for at least one of user, group, or other, then add or delete the execute ®le permission for who.

If ®le is not a directory, and no execute permissions are set in the current ®le mode, then do not change any execute permission.

Or one only of the following letters:

uCopy 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 speci®ed, and can override preceding operations speci®ed 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 ®le mode creation mask (see umask(1)). The s and t permissions are changed as if a was speci®ed in who.

Omitting permission is useful only when used with = to delete all permissions.

Section 184

− 1 −

HP-UX Release 11i: December 2000