LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   some files in a directory listable others invisible? (https://www.linuxquestions.org/questions/linux-newbie-8/some-files-in-a-directory-listable-others-invisible-4175428142/)

secretlydead 09-20-2012 01:30 AM

some files in a directory listable others invisible?
 
hi,

if i have rx permissions on a directory, is there a way i can make some files/directories within the directory listable while others remain invisible?

thanks.

jv2112 09-20-2012 04:29 AM

The leading " . " makes the files "invisible" You can rename the files to see or use the "a" option on ls. I would avoid renaming though as these are usually configuration files and renaming may break certain packages.

Most file managers also have options to show "invisible" files.

secretlydead 09-20-2012 08:13 AM

thanks for the reply.

I meant invisible to another user.

For example, if:
ls -l:
./ 611
../ 611
file1 610
file2 611

how can i make another user:
ls -l

and return

./
../
file2

i.e., don't show one of the files, the file where if the user:
cat file1
he would get a permission denied error

chrism01 09-20-2012 05:48 PM

Just amend the perms on the dir eg rwxrwx---.
If there is no-one else in your group, then rwx------

You can do the same to the files if you want. Don't have a Linux system in front of me to test all the permutations.


All times are GMT -5. The time now is 10:42 PM.