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

On wikipedia I read the following:

The read permission, which grants the ability to read a file. When set for a directory, this permission grants the ability to read the names of files in the directory (but not to find out any further information about them such as contents, file type, size, ownership, permissions, etc.)

With this, is there any way to only let people in my group see (read) the names of a subset of the files/directories I have in a directory?

E.g. if I have

A ---- B

can I modify permissions so that members of my groups can only see (read) the names C and D but not B? (if they ls A for example).

If this is not possible, what is the rationale behind it? What if I want to completely hide some files I have in my folders? What would the "UNIX way" of dealing with this situation?

share|improve this question
up vote 3 down vote accepted

Short answer: No. You cannot make only some files in a directory "invisible" to those that do not belong to certain group.

Have a look at the question Why do directories need the executable (X) permission to be opened? - the subject is nicely covered there, so I won't just replicate it here. The important thing to understand is that a directory is a separate entity - just as a file - so any permissions can only affect it as a whole.

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.