0

Related to file and directory permissions and umask: Why the command umask (shows the octal form) and umask -S (shows the symbolic form) show different (actually the option -S shows the bits negations of the octal form)? I was expecting the umask in symbolic form for umask 024 to be u=---,g=w,o=r but it shows like this:

[user1@server-base ~]$ umask
0024
[user1@server-base ~]$ umask -S
u=rwx,g=rx,o=wx

Terminal window

4
  • Partially. I mean it explains the use of umask and how the default permissions are obtained from base/initial permissions and umask. But why umask -S output shows the negation of umask output.
    – YAZ84
    Dec 20, 2020 at 9:50
  • This answer explains it best.
    – user986805
    Dec 20, 2020 at 10:16
  • 1
    @YAZ84 It's not the negation but the resulting permissions. Go with your example: umask 024 777 - 024 results in 753 which is u=rwx,g=rx,o=wx.
    – mook765
    Dec 20, 2020 at 10:24
  • source says: Print the umask in a symbolic form. In the output, a letter is printed if the corresponding bit is clear in the umask. so it's seems to be by design.
    – user986805
    Dec 20, 2020 at 10:31

0

Browse other questions tagged or ask your own question.