↑ ↓ select, Enter open, Esc close

Show the current umask

user@server
umask && umask -S

Prints the umask first in octal (such as 0022) and then symbolically (u=rwx,g=rx,o=rx). The umask subtracts permissions from the base values 666 for files and 777 for directories, so 022 results in 644 and 755. Explains why files created via SSH, cron or deploy scripts get different permissions than expected.

Note: umask 002 changes the value for the running shell, to make it permanent set it in ~/.profile, for example. PHP-FPM and other services have their own umask.

Also searched as

  • why do new files have wrong permissions
  • check umask linux
  • default permissions for new files
  • umask 022 or 002

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.