\begin{exe} {umask}

   Create an empty file with:

   \begin{cmd}
$ touch afile
$ ls -l afile
   \end{cmd}
   \begin{response}
-rw-rw-r-- 1 coop coop 0 Jul 26 12:43 afile
   \end{response}
   which shows it is created by default with both read and write
   permissions for owner and group, but only read for world.

   In fact, at the operating system level the default
   permissions given when creating a file or directory
   are actually read/write for owner, group \textbf{and}
   world (0666); the default values have actually been
   modified by the current \textbf{umask}.

   If you just type \textbf{umask} you get the current value:

   \begin{cmd}
$ umask
   \end{cmd}
   \begin{response}
0002
   \end{response}
   which is the most conventional value set by system
   administrators for users. This value is combined with the file
   creation permissions to get the actual result; i.e.,

   \begin{cmd}
0666 & ~002 = 0664; i.e., rw-rw-r--
   \end{cmd}

   Try modifying the \textbf{umask} and creating new files and
   see the resulting permissions, as in:

   \begin{cmd}
$ umask 0022
$ touch afile2
$ umask 0666
$ touch afile3
$ ls -l afile*
   \end{cmd}
\end{exe}

