Umask is a number which define the default permissions that is not given on a file or any directory.
How to Calculate Umask:
We can subtract the umask from the base permissions to determine the final permission to any file. Please see below example for more :-
Let's suppose umask 000
It means that User has 0, Group has 0 and other has 0 permission.
Now folder permission calculated as :-
User permission is 7-0 =7 (Read, Write and Execute)
Group Permission is 7-0 =7 (Read, Write and Execute)
Other Permission is 7-0 =7 (Read, Write and Execute)
Suppose umask 002
It means that User has 0, Group has 0 and other has 2 permission.
Now folder permission calculated as :-
User permission is 7-0 =7 (Read, Write and Execute)
Group Permission is 7-0 =7 (Read, Write and Execute)
Other Permission is 7-2 =5 (Read and Execute)
Suppose umask 022
It means that User has 0, Group has 2 and other has 2 permission
Now folder permission calculated as :-
User permission is 7-0 =7 (Read, Write and Execute)
Group Permission is 7-2 =5 (Read and Execute)
Other Permission is 7-2 =5 (Read and Execute)
Suppose umask 027
means User has 0, Group has 2 and other has 2.
Now folder permission calculated as :-
User permission is 7-0 =7 (Read, Write and Execute)
Group Permission is 7-2 =5 (Read and Execute)
Other Permission is 7-7 =0 (No permission)
Note : - To Find umask value use below command .
$ umask
output - 0022
To change Umask use this command .
$ umask 072
0 Comment(s)