The execute permission makes sense for files (which include scripts etc.), but when it comes to directories, the write (w) permission works the same way as execute (x), right?
Which means, if we are giving the write permission to a directory we also normally check “x” (for execute) for that directory as well, right?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
The execute permission on directories allows accessing files inside the directory. The read permission allows enumerating the directory entries. The write permission allows creating and removing entries in it.
Having read or write permission on a directory without execute permission is not useful. Having execute but not read permission is occasionally useful: it allows accessing files only if you know their exact name, a sort of primitive password protection.
So in practice the useful permissions on a directory are:
---: no access--x: can access files whose name is known (occasionally useful)r-x: normal read-only accessrwx: normal read and write access
See also Directory with +x permission, parents without it. When would this be useful? and Do the parent directory’s permissions matter when accessing a subdirectory?
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0