chmod.1 (2010 09)

c
chmod(1) chmod(1)
International Code Set Support
Single- and multibyte character code sets are supported.
RETURN VALUE
Upon completion,
chmod returns one of the following values:
0 Successful completion.
>0 An error condition occurred.
EXAMPLES
Deny write permission to others:
chmod o-w file
Make a file executable by everybody:
chmod a+x file
Assign read and execute permission to everybody, and set the set-user-ID bit:
chmod a=rx,u+s file
Assign read and write permission to the file owner, and read permission to everybody else:
chmod u=rw,go=r file
or the obsolescent form:
chmod 644 file
Traverse a directory subtree making all regular files 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 -S displays u=rwx,g=rx,o=rwx
; do not change write
permission for group) and the current permissions for file
mytest are 444 (a=r), displayed by
ls -l as
-r--r--r--, then the command
chmod +w mytest
sets the permissions to 646 (uo=rw,g=r), displayed by ls -l as -rw-r--rw-
.
If the current value of
umask is 020 (umask -S displays u=rwx,g=rx,o=rwx
; do not change write
permission for group) and the current permissions for file
mytest are 666 (a=rw), displayed by
ls -l
as -rw-rw-rw-, then the command
chmod -w mytest
sets the permissions to 464 (uo=r,g=rw), displayed by ls -l as -r--rw-r--
.
DEPENDENCIES
The
-A option causes chmod to fail on file 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
HP-UX 11i Version 3: September 2010 3 Hewlett-Packard Company 3