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. Directory read permits listing names but does not by itself allow traversal.
Incorrect. Write changes entries but does not provide search permission.
Incorrect. Write changes entries but does not provide search permission.
Incorrect. setuid is unrelated to ordinary directory traversal.
Incorrect. setuid is unrelated to ordinary directory traversal.
Correct. Directory execute/search permission allows traversal to a known entry.
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 / 自分が所有する一時ディレクトリ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.