Skip to content

Instantly share code, notes, and snippets.

@magnetikonline
Last active March 25, 2024 12:48
Show Gist options
  • Save magnetikonline/2edccbafecbea9726488c05afa866664 to your computer and use it in GitHub Desktop.
Save magnetikonline/2edccbafecbea9726488c05afa866664 to your computer and use it in GitHub Desktop.
Linux umask table.

Linux umask table

Umask is determined by subtracting (binary NOT) from the initial masks of:

  • File: 666 rw-rw-rw
  • Directory: 777 rwxrwxrwx

Therefore:

Umask File result Directory result
000 666 rw-rw-rw- 777 rwxrwxrwx
002 664 rw-rw-r-- 775 rwxrwxr-x
022 644 rw-r--r-- 755 rwxr-xr-x
027 640 rw-r----- 750 rwxr-x---
077 600 rw------- 700 rwx------
277 400 r-------- 500 r-x------
@remram44
Copy link

Correct file column:

Umask File result Directory result
000 666 rw-rw-rw- 777 rwxrwxrwx
002 664 rw-rw-r-- 775 rwxrwxr-x
022 644 rw-r--r-- 755 rwxr-xr-x
027 640 rw-r----- 750 rwxr-x---
077 600 rw------- 700 rwx------
277 400 r-------- 500 r-x------

@magnetikonline
Copy link
Author

magnetikonline commented Jun 21, 2021

Thanks @remram44 👍 - Clearly my maths was off when I wrote this!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment