If you remove the x (execute) permission from a directory, it effectively becomes a "look but don't touch" zone. Even if you own the directory, you will be blocked from most operations.
Here is exactly what happens:
1. You cannot "enter" it
The cd command will fail.
cd testdir
# Output: bash: cd: testdir: Permission denied
2. You cannot access files inside (even if you know their names)
Even if there is a file called notes.txt inside and you have permission to read that file, you cannot reach it because you can't "pass through" the directory.
cat testdir/notes.txt
# Output: cat: testdir/notes.txt: Permission denied
3. ls becomes very limited
If you still have r (read) permission but no x, you can see the filenames, but the system cannot retrieve any details about them (like size, type, or permissions).
ls -l testdir
# You might see just filenames with a bunch of question marks (?????)
Want to try it? (Interactive Example)
You can actually test this safely in your current environment!
-
Remove the
xpermission fromtestdir:chmod -x testdir -
Try to enter it:
cd testdir(You will get: Permission denied)
-
Give the permission back when you're done:
chmod +x testdir
Summary: Without x, the directory acts like a locked room. You might be able to peek through the keyhole (if you have r), but you can't step inside or touch anything!