DATA Step, Macro, Functions and more

Shell command to show all Groups and users that access or reads a folder or a file

Reply
Regular Contributor
Posts: 222

Shell command to show all Groups and users that access or reads a folder or a file

Hi experts,

 

I'm using unix environment.

 

Is there a shell command to list all groups or users that have access to a specific location or file ?

 

ls -l does not work for me, because i need all users that can read from that directory.

 

Thanks in advance

Super User
Posts: 9,548

Re: Shell command to show all Groups and users that access or reads a folder or a file

Posted in reply to DartibaliRodrigo

ls -l is the primary tool for this. It shows you the permissions for the owner, the group and all others.

On top of that, you may have an access control list (ACL) defined. On AIX, one uses aclget to retrieve that information.

This is all you need for determining access to a directory/file.

 

To display members of a group, use the lsgroup command.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Regular Contributor
Posts: 222

Re: Shell command to show all Groups and users that access or reads a folder or a file

Posted in reply to KurtBremser

I need to show groups per folder/directory.

 

For example:

 

staff | /prod/crm

controlm | /prod/bi

 

Thanks

Super User
Posts: 9,548

Re: Shell command to show all Groups and users that access or reads a folder or a file

Posted in reply to DartibaliRodrigo

If "others" have read permission, everybody has access. If not, but the group has read permission, then all members of this group have access. If neither, only the owner has access. That's it. Unless you have defined ACL's.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 3 replies
  • 81 views
  • 0 likes
  • 2 in conversation