1

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)

  1. I have a structure like $ src/x/B.java so when I checked permissions for src it was:

    drwxr-xr-x  4 gtee  staff  136 Feb 17 23:17 src 
    

    i.e. 755 (777-022) which is as per above .

  2. 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?

hek2mgl
  • 152,036
  • 28
  • 249
  • 266
pooja
  • 11
  • 2
  • The permission bits of the directory may be changed after it is created; could that have happened here? You don't tell us how these directories were created and when they were checked. – mpez0 Feb 17 '15 at 20:11
  • I did not change the umask value any time but 'src' folder is created using "mkdir src" in script and then everything from some location is copied to 'src' folder using "cp -r" due to which 'x' is copied inside 'src' as part of that cp command. So how is the permission for this copied directory decided by default ?? – pooja Feb 17 '15 at 20:47
  • Can someone please explain why the permission for 'x' folder is 555 instead of 755 and umask is 0022 ??? As far as I know permissions of this copied folder are calculated using 777 - 022 = 755 but why its 555 ?? – pooja Feb 18 '15 at 05:07

0 Answers0