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.53.
1   umask
2   umask 027

EXPLANATION

  1. Displays the current file permission mask.

  2. The directory permissions, 777, ...

Get UNIX® Shells by Example, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.