umask
FilesAdvanced In simulator In real LinuxSet the default permission mask for new files
Name: umask = user file-creation mask
You can practise it right away in the simulator, and use it in real Linux mode too.
Description
umask is a shell builtin that sets which permission bits are removed from new files and directories. Files start from 666 and directories from 777, minus the mask: with umask 022 you get 644 files and 755 directories.
It affects the current shell and its children; put it in ~/.bashrc to make it permanent.
Syntax
umask [-S] [MASK]Common options
| -S | Show symbolically, e.g. u=rwx,g=rx |
| -p | Print it as a command you can run (umask 0022) |
| 022 | Common value: new files 644, directories 755 |