I usually setup my umask value in my login rc. For KSH, that is in "$HOME/.profile". For CSH, "$HOME/.login". For Bash, "$HOME/.bash_profile". That works well because your login shell will be the parent of all the sub-processes you create, and receive a copy of that environment.
"umask 022" or "umask 0022" is the default when not specified. This equates to "chmod 644".
# umask
0022
# touch test
# ls -l test
-rw-r--r-- 1 root root 0 Apr 3 10:04 test
I normally set it to "umask 002", allowing members of my group to have write access to anything I create, resulting in "chmod 664".
# umask 002
# umask
0002
# touch test
# ls -l test
-rw-rw-r-- 1 root root 0 Apr 3 10:06 test
Verify what is currently active with "umask" and no arguments.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.