Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 4
    Incidentally, the value for the "d" is 040000 - it can be found in header files under the name S_IFDIR. You don't use it when setting the file mode, but the stat() function actually returns the value 040750 for drwxr-x---. Commented Feb 10, 2015 at 18:07
  • To your final question, I'd answer with another question: why do some people use octal permissions (e.g. 0777) instead of the much more comprehensible (ugo)(+-)(rwx)? Is it just the geek equivalent of a jacked-up pickup? Commented Feb 10, 2015 at 18:31
  • 2
    @jamesqf Actually, now that I understand how the octal codes map, it's simpler for me to think about that way. Commented Feb 10, 2015 at 22:12
  • @jamesqf it's much faster to type, when you're specifying the full set of permissions, than e.g. u=rwx,g=rx,o= for 750. Commented Feb 10, 2015 at 22:23
  • @Random832: But at least for me, any saving in typing speed is more than outweighed by the time needed to mentally translate between numbers and permissions. The more so as I seldom if ever want to set all permissions: I simply want to set execute or r/w permission. So about 90% of my chmod calls are just "chmod u+x". Commented Feb 10, 2015 at 23:03