Interview Q&A / Linux & Shell

IntermediateQuick answer1 min readUpdated 3 Oct 2026

What does the execute permission mean on a directory?

SHORT ANSWER

On a directory, execute (x) means permission to enter it and access items by name. Read (r) lets you list names, and write (w) lets you create or delete entries. Without x on a directory you cannot cd into it or open files inside, even if the files themselves are readable.

Explain it simply

A directory is like a lift lobby in an apartment. Execute is the permission to walk in and reach the flats. Read is permission to see the board listing flat names. Write is permission to add or remove names from that board.

So the three bits work differently than on files:

  • r lets ls list names.
  • x lets you cd in and open known files, and reach everything below.
  • w (together with x) lets you create, rename and delete entries.

Combinations that surprise people: r-- lists names but you cannot read their details or open them; --x lets you open a file if you know its exact name but you cannot list the folder. That second pattern is a real technique for hiding files in shared hosting.

Also, to reach /home/amit/docs/a.txt you need x on every directory in the path.

Example

bash
mkdir box && echo hi > box/a.txt
chmod 600 box        # remove x
cat box/a.txt
# cat: box/a.txt: Permission denied
chmod 700 box
cat box/a.txt
# hi

What to say in the interview

"For directories, r lists names, x allows entering and accessing items, and w with x allows creating and deleting entries. A missing x on any folder in the path blocks access to everything beneath it, even if the file itself is readable."

Common mistakes

  • Giving directories 644; they need x to be usable.

#linux#permissions#directories

Related questions

Practise more Linux & Shell questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Linux & Shell quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.