umask-sets file-creation mode mask for permissions

 <  Day Day Up  >  

umask ”sets file-creation mode mask for permissions

 umask [ ooo ] 

The user file-creation mode mask is set to 000 . The three octal digits refer to read/write/execute permissions for owner, group , and other, respectively. The value of each specified digit is subtracted from the corresponding ''digit'' specified by the system for the creation of a file. 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 000 is omitted, the current value of the mask is printed. umask is recognized and executed by the shell.

Example A.64.
 1   umask 2   umask 027 

EXPLANATION

  1. Displays the current file permission mask.

  2. The directory permissions, 777, minus the umask 027 is 750. The file permissions, 666, minus the umask 027 is 640. When created, directories and files will be assigned the permissions created by umask .

 <  Day Day Up  >  


UNIX Shells by Example
UNIX Shells by Example (4th Edition)
ISBN: 013147572X
EAN: 2147483647
Year: 2004
Pages: 454
Authors: Ellie Quigley

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net