Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
  |
  |----C
  |
  |----D

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.