Help cleanup
Large list of changes, including formatting and typos for most commands.
More substantive changes have been made to alias, bind, block, break,
builtin, case, cd, commandline, count, else, emit, fish_config, funced,
function, functions, history, math, mimedb, nextd, not, popd, prevd,
pushd, pwd, random, read, set, set_color, switch, test, trap, type,
ulimit, umask, and while.
2013-05-12 15:56:01 +08:00
|
|
|
\section umask umask - set or get the file creation mode mask
|
2005-10-17 22:30:50 +08:00
|
|
|
|
|
|
|
\subsection umask-synopsis Synopsis
|
2014-08-01 20:25:41 +08:00
|
|
|
\fish{synopsis}
|
2014-08-01 10:37:32 +08:00
|
|
|
umask [OPTIONS] [MASK]
|
|
|
|
\endfish
|
2005-10-17 22:30:50 +08:00
|
|
|
|
|
|
|
\subsection umask-description Description
|
|
|
|
|
2014-08-01 10:37:32 +08:00
|
|
|
`umask` displays and manipulates the "umask", or file creation mode mask,
|
Help cleanup
Large list of changes, including formatting and typos for most commands.
More substantive changes have been made to alias, bind, block, break,
builtin, case, cd, commandline, count, else, emit, fish_config, funced,
function, functions, history, math, mimedb, nextd, not, popd, prevd,
pushd, pwd, random, read, set, set_color, switch, test, trap, type,
ulimit, umask, and while.
2013-05-12 15:56:01 +08:00
|
|
|
which is used to restrict the default access to files.
|
2005-10-23 20:14:29 +08:00
|
|
|
|
Help cleanup
Large list of changes, including formatting and typos for most commands.
More substantive changes have been made to alias, bind, block, break,
builtin, case, cd, commandline, count, else, emit, fish_config, funced,
function, functions, history, math, mimedb, nextd, not, popd, prevd,
pushd, pwd, random, read, set, set_color, switch, test, trap, type,
ulimit, umask, and while.
2013-05-12 15:56:01 +08:00
|
|
|
The umask may be expressed either as an octal number, which represents
|
|
|
|
the rights that will be removed by default, or symbolically, which represents
|
|
|
|
the only rights that will be granted by default.
|
|
|
|
|
2014-08-01 10:37:32 +08:00
|
|
|
Access rights are explained in the manual page for the `chmod`(1) program.
|
Help cleanup
Large list of changes, including formatting and typos for most commands.
More substantive changes have been made to alias, bind, block, break,
builtin, case, cd, commandline, count, else, emit, fish_config, funced,
function, functions, history, math, mimedb, nextd, not, popd, prevd,
pushd, pwd, random, read, set, set_color, switch, test, trap, type,
ulimit, umask, and while.
2013-05-12 15:56:01 +08:00
|
|
|
|
|
|
|
With no parameters, the current file creation mode mask is printed as
|
|
|
|
an octal number.
|
|
|
|
|
2014-08-01 10:37:32 +08:00
|
|
|
- `-h` or `--help` prints this message.
|
|
|
|
- `-S` or `--symbolic` prints the umask in symbolic form instead of octal form.
|
|
|
|
- `-p` or `--as-command` outputs the umask in a form that may be reused as input
|
Help cleanup
Large list of changes, including formatting and typos for most commands.
More substantive changes have been made to alias, bind, block, break,
builtin, case, cd, commandline, count, else, emit, fish_config, funced,
function, functions, history, math, mimedb, nextd, not, popd, prevd,
pushd, pwd, random, read, set, set_color, switch, test, trap, type,
ulimit, umask, and while.
2013-05-12 15:56:01 +08:00
|
|
|
|
|
|
|
If a numeric mask is specified as a parameter, the current shell's umask
|
|
|
|
will be set to that value, and the rights specified by that mask will be
|
|
|
|
removed from new files and directories by default.
|
|
|
|
|
|
|
|
If a symbolic mask is specified, the desired permission bits, and
|
2005-10-23 20:14:29 +08:00
|
|
|
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
|
2014-08-01 10:37:32 +08:00
|
|
|
be one of `u`, `g`, `o` or `a`, where `u` specifies the user who
|
|
|
|
owns the file, `g` specifies the group owner of the file, `o`
|
|
|
|
specific other users rights and `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
|
2014-08-01 10:37:32 +08:00
|
|
|
=, `+` or `-`, where `=` specifies that the rights should be set to
|
|
|
|
the new value, `+` specifies that the specified right should be added
|
|
|
|
to those previously specified and `-` specifies that the specified
|
2005-10-23 20:14:29 +08:00
|
|
|
rights should be removed from those previously specified.
|
|
|
|
- The third part of a right specifies what rights should be changed
|
2014-08-01 10:37:32 +08:00
|
|
|
and can be any combination of `r`, `w` and `x`, representing
|
2005-10-23 20:14:29 +08:00
|
|
|
read, write and execute rights.
|
|
|
|
|
2014-08-01 10:37:32 +08:00
|
|
|
If the first and second parts are skipped, they are assumed to be `a`
|
|
|
|
and `=`, respectively. As an example, `r,u+w` means all
|
2005-10-23 20:14:29 +08:00
|
|
|
users should have read access and the file owner should also have
|
|
|
|
write access.
|
2005-10-17 22:30:50 +08:00
|
|
|
|
Help cleanup
Large list of changes, including formatting and typos for most commands.
More substantive changes have been made to alias, bind, block, break,
builtin, case, cd, commandline, count, else, emit, fish_config, funced,
function, functions, history, math, mimedb, nextd, not, popd, prevd,
pushd, pwd, random, read, set, set_color, switch, test, trap, type,
ulimit, umask, and while.
2013-05-12 15:56:01 +08:00
|
|
|
Note that symbolic masks currently do not work as intended.
|
2005-10-17 22:30:50 +08:00
|
|
|
|
|
|
|
\subsection umask-example Example
|
|
|
|
|
2014-08-01 10:37:32 +08:00
|
|
|
`umask 177` or `umask u=rw` 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
|
|
|
|