There is a file in a directory that me and the other users want to be able to read. I want the other users not to be able to see the other files in the directory. They should be able to read a specific file in a directory if they know the name of the file.
Limited access to a directory's contents
files;permissions;directory
I'm assuming you want to create a directory which other members of your group cannot list, but where you can make files accessible to them anyway... Accessing a directory requires the execute permission, listing its contents requires the read permission. If you make a directory executable but not readable, users can access files stored within but can't list its contents. Given a shared group:mkdir -m710 demochgrp shared demoecho secret > demo/file1chmod 640 demo/file1Then other users in the shared group will be able to view the contents of demo/file1, but ls demo will fail.Note that if others guess the names of other files, they will be able to access those files, if they have the permission. So make sure to keep the other files private.