2007-03-25 03:16:46 +08:00
\section umask umask - set or get the file-creation mask
2005-10-17 22:30:50 +08:00
\subsection umask-synopsis Synopsis
<code>umask [OPTIONS] [MASK]</code>
\subsection umask-description Description
With no argument, the current file-creation mask is printed, if an
2005-10-22 18:06:05 +08:00
argument is specified, it is the new file creation mask. The mask may
be specified as an octal number, in which case it is interpreted as
the rights that should be masked away, i.e. it is the inverse of the
2006-01-24 07:17:06 +08:00
file permissions any new files will have.
2005-10-23 20:14:29 +08:00
If a symbolic mask is specified, the actual file permission bits, and
not the inverse, should be specified. A symbolic mask is a comma
separated list of rights. Each right consists of three parts:
- The first part specifies to whom this set of right applies, and can
be one of \c u, \c g, \c o or \c a, where \c u specifies the user who
owns the file, \c g specifies the group owner of the file, \c o
2006-01-24 07:17:06 +08:00
specific other users rights and \c a specifies all three should be
2005-10-23 20:14:29 +08:00
changed.
- The second part of a right specifies the mode, and can be one of \c
=, \c + or \c -, where \c = specifies that the rights should be set to
the new value, \c + specifies that the specified right should be added
to those previously specified and \c - specifies that the specified
rights should be removed from those previously specified.
- The third part of a right specifies what rights should be changed
2006-01-24 07:17:06 +08:00
and can be any combination of \c r, \c w and \c x, representing
2005-10-23 20:14:29 +08:00
read, write and execute rights.
If the first and second parts are skipped, they are assumed to be \c a
and \c =, respectively. As an example, <code>r,u+w</code> means all
users should have read access and the file owner should also have
write access.
2005-10-17 22:30:50 +08:00
- <code>-h</code> or <code>--help</code> print this message
- <code>-S</code> or <code>--symbolic</code> prints the file-creation mask in symbolic form instead of octal form. Use <code>man chmod</code> for more information.
- <code>-p</code> or <code>--as-command</code> prints any output in a form that may be reused as input
2005-10-22 18:06:05 +08:00
The umask implementation in fish should behave identically to the one
in bash.
2005-10-17 22:30:50 +08:00
\subsection umask-example Example
2007-09-24 05:07:30 +08:00
<code>umask 177</code> or <code>umask u=rw</code> sets the file
2005-10-22 18:06:05 +08:00
creation mask to read and write for the owner and no permissions at
all for any other users.
2005-10-17 22:30:50 +08:00