umask(1)
NAME
umask − shell built-in function to restrict read/write/execute permissions
SYNOPSIS
sh
umask [ ooo ]
csh
umask [ ooo ]
ksh
umask [ mask ]
DESCRIPTION
sh
The user file-creation mode mask is set to ooo. The three octal digits refer to read/write/execute permissions for owner, group, and other, respectively (see chmod(1), chmod(2), and umask(2)). The value of each specified digit is subtracted from the corresponding “digit” specified by the system for the creation of a file (see creat(2)). For example, umask 022 removes write permission for group and other (files normally created with mode 777 become mode 755; files created with mode 666 become mode 644).
If ooo is omitted, the current value of the mask is printed.
umask is recognized and executed by the shell.
umask can be included in the user’s .profile (see profile(4) ) and invoked at login to automatically set the user’s permissions on files or directories created.
csh
See the description above for the Bourne shell (sh) umask built-in.
ksh
The user file-creation mask is set to mask. mask can either be an octal number or a symbolic value as described in chmod(1). If a symbolic value is given, the new umask value is the complement of the result of applying mask to the complement of the previous umask value. If mask is omitted, the current value of the mask is printed.
SEE ALSO
chmod(1), csh(1), ksh(1), sh(1), chmod(2), creat(2). profile(4)
SunOS 5.4 — Last change: 15 Apr 1994