Welcome to the 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

  • coop
    coop Posts: 916

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

  • jengel
    jengel Posts: 41

    Thank you.

  • coop
    coop Posts: 916

    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.

  • jengel
    jengel 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).

Categories

Upcoming Training