c

chmod(1)

chmod(1)

chmod a+x ®le

Assign read and execute permission to everybody, and set the set-user-ID bit:

chmod a=rx,u+s ®le

Assign read and write permission to the ®le owner, and read permission to everybody else:

chmod u=rw,go=r ®le

or the obsolescent form:

chmod 644 ®le

Traverse a directory subtree making all regular ®les readable by user and group only, and all executables and directories executable (searchable) by everyone:

chmod -R ug+r,o-r,a+X pathname

If the current value of umask is 020 (umask -Sdisplays u=rwx,g=rx,o=rwx; do not change write permission for group) and the current permissions for ®le mytest are 444 (a=r), displayed by ls -las -r--r--r--, then the command

chmod +w mytest

sets the permissions to 646 (uo=rw,g=r), displayed by ls -las -rw-r--rw-.

If the current value of umask is 020 (umask -Sdisplays u=rwx,g=rx,o=rwx; do not change write permission for group) and the current permissions for ®le mytest are 666 (a=rw), displayed by ls -las -rw-rw-rw-, then the command

chmod -w mytest

sets the permissions to 464 (uo=r,g=rw), displayed by ls -las -r--rw-r--.

DEPENDENCIES

The -Aoption causes chmod to fail on ®le systems that do not support ACLs.

AUTHOR

chmod was developed by AT&T and HP.

SEE ALSO

chacl(1), ls(1), umask(1), chmod(2), acl(5), aclv(5).

STANDARDS CONFORMANCE

chmod: SVID2, SVID3, XPG2, XPG3, XPG4, POSIX.2

Section 186

− 3 −

HP-UX Release 11i: December 2000