Access a known file inside docs by its pathname.
Listing the directory contents is not required.
Which directory permission is required to traverse to the file?
The directory x bit is also called search permission and permits pathname traversal to known entries. The r bit is for listing names.
Detailed explanation
Incorrect. Directory read permits listing names but does not by itself allow traversal.
Incorrect. Write changes entries but does not provide search permission.
Incorrect. setuid is unrelated to ordinary directory traversal.
Correct. Directory execute/search permission allows traversal to a known entry.
Try it yourself
An example you can run in a temporary verification environment.
tmp=$(mktemp -d); mkdir "$tmp/docs"; touch "$tmp/docs/item"; chmod 111 "$tmp/docs"; test -e "$tmp/docs/item" && echo reachable; chmod 700 "$tmp/docs"; rm -rf "$tmp"Expected result
reachableKey points
- Directory r lists names
- Directory w changes entries
- Directory x permits search/traversal
Notes
- Environment: POSIX shell / 自分が所有する一時ディレクトリ
- Use a disposable file or directory when checking chmod calculations.
- Exact permission display can vary slightly with filesystem and distribution defaults.
Foundation review
Place the operation
Directory execute/search permission is distinct from directory read; access to a known child can work without listing names.
Check the side effect
Evaluate permissions on every directory component in the path, not only on the final file.