The umask command

Display or set file mode mask. 4 examples from the lessons of the IVski Linux Playground — try them in the terminal next to them.

Options in the examples

-S
makes the output symbolic; otherwise an octal number is output

Examples

umask

0022

umask -S

u=rwx,g=rx,o=rx — what new files may get

umask 077

only I can read and write what I make

(umask 077; echo "token=abc123" > secret.txt)

Lessons that use umask