HP-UX Reference (11i v3 07/02) - 1 User Commands N-Z (vol 2)
u
umask(1) umask(1)
RETURN VALUE
umask exits with one of the following values:
0 The file mode creation mask was successfully changed or no mask operand was supplied.
>0 An error occurred.
EXAMPLES
In these examples, each line show an alternate way of accomplishing the same task.
Set the umask value to produce read and write permissions for the file’s owner and read permissions for all
others (ls -l displays -rw-r--r-- on newly created files):
umask u=rwx,g=rx,o=rx
symbolic mode
umask a=rx,u+w symbolic mode
umask 022 numeric mode
Set the umask value to produce read, and write permissions for the file’s owner, read-only for others users
in the same group, and no access to others (
-rw-r----- ):
umask a-rwx,u+rw,g+r
symbolic mode
umask u=rw,g=r,o= symbolic mode
umask ,u+rw,g+r symbolic mode
umask 137 numeric mode
Set the umask value to deny read, write, and execute permissions to everyone (----------
):
umask a= symbolic mode
umask 777 numeric mode
Add the write permission to the current mask for everyone (there is no equivalent numeric mode):
umask a+w symbolic mode
WARNINGS
If you set a mask that prevents read or write access for the user (owner), many programs, such as editors,
that create temporary files will fail because they cannot access the file data.
DEPENDENCIES
The umask command is implemented both as a separate executable file (/usr/bin/umask
) and as
built-in shell commands.
POSIX Shell and Separate File
All features are supported (see sh-posix(1)). The numeric mask display uses a minimum of two digits.
Korn Shell
The
-S option is not supported in the Korn shell built-in command (see ksh(1)). The numeric mask display
uses a minimum of two digits.
C Shell
The
-S option and symbolic mask values are not supported in the C shell built-in command (see csh(1)).
The numeric mask display uses a minimum of one digit.
SEE ALSO
chmod(1), csh(1), ksh(1), sh-posix(1), sh(1), chmod(2), creat(2), umask(2).
STANDARDS CONFORMANCE
umask: SVID2, SVID3, XPG2, XPG3, XPG4, POSIX.2
358 Hewlett-Packard Company − 3 − HP-UX 11i Version 3: February 2007