Umask: Difference between revisions
(Created page with "=External= * http://en.wikipedia.org/wiki/Umask =Internal= * Linux =Overview= umask sets the user file-creation mask. The digits in the mask represe...") |
|||
Line 13: | Line 13: | ||
The digits in the mask represent privileges that are '''not''' assigned to the file or directory that is being created: the mask ''restricts'' which permissions are allowed. | The digits in the mask represent privileges that are '''not''' assigned to the file or directory that is being created: the mask ''restricts'' which permissions are allowed. | ||
If the mask bit is set to "1", the corresponding permission will be disabled. For a bit set to "0", the corresponding permission will be determined by the program. The mask acts as a last-stage filter that strips away permissions as a file or directory is created where the bit that is set to a "1". If mode begins with a digit, it is interpreted as an octal number; otherwise it is interpreted as a symbolic mode mask similar to that accepted by [[chmod]]. If mode is omitted, the current value of the mask is printed. The -S option causes the mask to be printed in symbolic form; the default output is an octal number. If the -p option is supplied, and mode is omitted, the output is in a form that may be reused as input. The return status is 0 if the mode was successfully changed or if no mode argument was supplied, and false otherwise. | If the mask bit is set to "1", the corresponding permission will be disabled. For a bit set to "0", the corresponding permission will be determined by the program. The mask acts as a last-stage filter that strips away permissions as a file or directory is created where the bit that is set to a "1". | ||
If mode begins with a digit, it is interpreted as an octal number; otherwise it is interpreted as a symbolic mode mask similar to that accepted by [[chmod]]. If mode is omitted, the current value of the mask is printed. The -S option causes the mask to be printed in symbolic form; the default output is an octal number. If the -p option is supplied, and mode is omitted, the output is in a form that may be reused as input. The return status is 0 if the mode was successfully changed or if no mode argument was supplied, and false otherwise. | |||
=Examples= | =Examples= |
Latest revision as of 19:45, 6 August 2017
External
Internal
Overview
umask sets the user file-creation mask.
The digits in the mask represent privileges that are not assigned to the file or directory that is being created: the mask restricts which permissions are allowed.
If the mask bit is set to "1", the corresponding permission will be disabled. For a bit set to "0", the corresponding permission will be determined by the program. The mask acts as a last-stage filter that strips away permissions as a file or directory is created where the bit that is set to a "1".
If mode begins with a digit, it is interpreted as an octal number; otherwise it is interpreted as a symbolic mode mask similar to that accepted by chmod. If mode is omitted, the current value of the mask is printed. The -S option causes the mask to be printed in symbolic form; the default output is an octal number. If the -p option is supplied, and mode is omitted, the output is in a form that may be reused as input. The return status is 0 if the mode was successfully changed or if no mode argument was supplied, and false otherwise.
Examples
Completely Isolate
Set in .bashrc or .bash_profile
umask 0077