Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like the following result on my UNIX system:

ls -l /users/test -> permission denied, or any other way so I can't see the content of it.

ls -l /users/test/testdir/ -> shows all files in the directory

Do you have any solutions for this?

share|improve this question
up vote 2 down vote accepted

By leaving only execute permissions on the parent folder and normal permissions on the child directory, you can enter the parent directory but be unable to view its contents unless you know the exact filename.


mkdir -p a/b
touch a/{1,2,3} a/b/{p,o,i}
chmod 111 a
ls -la a      #Permission denied
ls -la a/b    #Lists i and o and p
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.