: Linux command to set the file creation mask.
In my own words, I think that you can set a umask in several different locations (fstab?), and possibly different umasks for different directories or users. Once a umask is set, when a file is created, its default permissions are a function of the umask. Example: if the umask is 022 new files are created with permissions 0666 & ~022 = 0644 (= rw-r--r--).
The following is quoted from the Linux Programmer's Manual at http://unixhelp.ed.ac.uk/CGI/man-cgi?umask+2
-- I still don't know how to invoke it, or when it works.
umask sets the umask to mask & 0777.
The umask is used by open(2) to set initial file permissions on a newly-created file. Specifically, permissions in the umask are turned off from the mode argument to open(2) (so, for example, the common umask default value of 022 results in new files being created with permissions 0666 & ~022 = 0644 = rw-r--r-- in the usual case where the mode is specified as 0666).
- RandyKramer - 16 Jan 2002
- <If you edit this page, add your name here, move this to the next line>