home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: tty Chapter 2
UNIX Commands
Next: Reference: uname
 

umask



umask

 [

value

]

Print the current value of the file creation mode mask, or set it to value , a three-digit octal code specifying the read-write-execute permissions to be turned off. This is the opposite of chmod . Usually used in .login or .profile . umask is available as a built-in command in the Bourne and C shells (see Sections 4 and 5).

umask Number

File Permission

Directory Permission

0 rw- rwx
1 rw- rw-
2 r-- r-x
3 r-- r--
4 -w- -wx
5 -w- -w-
6 -- -x
7 -- --

Examples

Turn off write permission for others:


umask 002	
Produces file permission 
-rw-rw-r-

Turn off all permissions for group and others:


umask 077	
Produces file permission 
-rw----

Note that you can omit leading zeroes.


Previous: Reference: tty UNIX in a Nutshell: System V Edition Next: Reference: uname
Reference: tty Book Index Reference: uname

The UNIX CD Bookshelf Navigation The UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System