ACE-P-ALE1-04 practice question 15 of 35

The cd into a directory, you need what kind of permission?

Full set: 100 questions
Answer options
A: read
B: write
C: execute Correct answer
D: setuid
Correct Answer:
C. execute
Explanation

In Linux and other UNIX-like operating systems, permissions for directories are interpreted differently than for files. The execute (x) permission on a directory grants the ability to traverse it. This means a user can pass through the directory to access files or subdirectories within it. The cd (change directory) command requires this permission to make the target directory the new current working directory. Without execute permission, you cannot enter the directory, even if you have read permissions to see its contents.

Why Incorrect

A. read: Read permission on a directory only allows you to list its contents (e.g., using ls), not to enter it or access the files listed.
B. write: Write permission on a directory allows you to create, delete, or rename files and subdirectories within it, but it does not grant access to enter the directory.
D. setuid: The setuid bit is a special permission that has no effect on the ability to cd into a directory; it primarily affects file execution or ownership of new files.

References

1. Arista Networks (2023). Arista Linux Essentials for Network Engineers. Chapter 3: The Linux Filesystem, Section: "File and Directory Permissions". The guide explicitly states: "For a directory, execute permission allows a user to enter the directory (i.e., make it the current directory)."

2. Garrels, M. (2008). Introduction to Linux - A Hands on Guide. The Linux Documentation Project. Chapter 4, Section 4.3.2: "Permissions". This document clarifies, "For a directory, execute permission is needed to be able to cd to that directory."

3. Massachusetts Institute of Technology (2012). MIT OpenCourseWare, 6.828: Operating System Engineering, Fall 2012. Lecture 10: File systems. The lecture notes explain that the execute bit on a directory allows a process to "search" or "traverse" it, which is the fundamental operation performed by cd.

Scroll to Top