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?

1 Answer 1


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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .