3 ms·
One of the most confusing yet important thing I learned as student from working with Linux is the execute bit on directory. It is important not to do chmod -R 7
by yeukhon 13y ago
One of the most confusing yet important thing I learned as student from working with Linux is the execute bit on directory. It is important not to do chmod -R 755 mydir because you will give execution bit to files as well.
https://www.washington.edu/computing/unix/permissions.html https://www.washington.edu/computing/unix/permissions.html
- thristian 13y agoGNU chmod lets you say *chmod -R a+X mydir" (an uppercase X) which, instead of giving everybody execute permission on all files and directories, will give everybody execute permission only on directories, and files that already have some execute bit set.
- e12e 13y agoThat's afaik not a GNUism: http://www.freebsd.org/cgi/man.cgi?query=chmod http://www.freebsd.org/cgi/man.cgi?query=chmod [edit: If I'm reading this right (I seldom have reason to look up Posix things, being generally concerned with concrete implementations) -- it's actuallly a BSDism that's been incorporated into Posix: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/chmod.html http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ch... ]
- ecma 13y agoThat's correct, +X was adopted from BSD into POSIX.2001. There's a paragraph in §Rationale about it.
- thristian 13y agoThe first draft of my comment started "GNU chmod, at least,..." but then I wound up with too many comma-delimited clauses and I dropped the qualifier to keep things readable. Thanks for looking up citations. :)