Welcome to the new Linux Foundation Forum!

Understanding umask -S (demo 32.10)

I have no problem understanding umask and its meaning. Thus I can interpret the output of umask.

In the demo we see the output of "umask -S" which show the symbolic representation of default permissions (and not the actual mask).

$ umask -S -p
umask -S u=rwx,g=rwx,o=rx

The part that bug me is the "x", which would be true for directories. However, by default files don't get it. Would this mean as far masking go "x" is assumed to only apply to directories?

Comments

  • coopcoop Posts: 307

    Yes. "x" is for directories. "x" for directories means users can cd to it and access files and subdirectories.

  • jengeljengel Posts: 41

    Thank you.

  • coopcoop Posts: 307

    Yes, to convince myself I did some experiments with changing umask to things like 666 and making directories and files etc. Behaviour is consistent with documentation.

  • jengeljengel Posts: 41

    Thank you for confirming. I had not doubts about the numbers. just the -S representation read odd for me (with the x).

    That made me realise also, it is impossible to set umask to make files executable by default (not that one would want to).

Sign In or Register to comment.