I checked that umask value is 0022 in my Linux machine and I know the way to find permissions is as follows:
- Directory base permissions: 777
- umask value: 022
- Subtract to get permissions of new directory (777-022) : 755 (rwxr-xr-x)
I have a structure like
$ src/x/B.java
so when I checked permissions forsrc
it was:drwxr-xr-x 4 gtee staff 136 Feb 17 23:17 src
i.e. 755 (777-022) which is as per above .
But when I checked permission for
x
it was:dr-xr-xr-x 4 gtee staff 136 Feb 17 23:17 x
i.e. 555, but how this value is assigned? I don’t understand this.
As x
is also a directory, why isn’t it 777-022?