Você está na página 1de 1

Umask - Wikipedia, the free encyclopedia http://en.wikipedia.

org/wiki/Umask

Umask
From Wikipedia, the free encyclopedia

The title of this article should be umask. The initial letter is capitalized due to technical restrictions.

umask (abbreviated from user file creation mode mask) is a function on POSIX environments which sets the default
file system mode for newly created files of the current process. To create files with given permissions, the
corresponding umask value can be caluclated using two equivalent methods: (note that umasks must always be
calculated in octal)

- bitwise exclusive OR operation of the argument and the full access mode 777.

- bitwise AND of the unary complement of the argument (using bitwise NOT) and the full access mode 777.

Most Unix shells provide an umask command that affects all child processes executed in this shell.

Examples
To set the mode of newly created files to 0600 (-rw------) we need

7778 ^ ~1778 = 6008

Thus, umask has to be run with the value 177:

umask 177

See also
chmod

External links
Manpage of umask(2) (http://www.openbsd.org/cgi-bin/man.cgi?query=umask&sektion=2) from OpenBSD

Retrieved from "http://en.wikipedia.org/wiki/Umask"

Categories: Article titles with lowercase initial letters | Unix software

This page was last modified 23:30, 24 May 2006.


All text is available under the terms of the GNU Free Documentation License (see Copyrights for
details).
Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc.

1 of 1 07-06-2006 11:03

Você também pode gostar