Operating System - HP-UX
1839653 Members
2586 Online
110152 Solutions
New Discussion

Which files have run as user/group execution bit set ?

 
SOLVED
Go to solution
wvsa
Regular Advisor

Which files have run as user/group execution bit set ?

Fellow Admins,

How can I find which files have the user/execution bit set? Thankyou in advance for your responses
6 REPLIES 6
RAC_1
Honored Contributor
Solution

Re: Which files have run as user/group execution bit set ?

for uid set files

find . -type f -perm 4000

For setgid

find . -type f -perm 2000

Anil
There is no substitute to HARDWORK
A. Clay Stephenson
Acclaimed Contributor

Re: Which files have run as user/group execution bit set ?

I think you must be talking about the setuid and setgid bits set.

This will do the setuid bit (4000 octal):
find /usr -perm -4000

This will do the setgid bit (2000 octal)
find /dir -perm -2000
If it ain't broke, I can fix that.
Doug Burton
Respected Contributor

Re: Which files have run as user/group execution bit set ?

Try this:
find / \( -perm -4000 -o -perm -2000 \) -type f -exec ls -ld {} \;
Jeff Schussele
Honored Contributor

Re: Which files have run as user/group execution bit set ?

Hi,

Use

find /top_dir -type f -perm -u+s -print

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Jeff Schussele
Honored Contributor

Re: Which files have run as user/group execution bit set ?

Oops forgot the GID bit

find /top_dir -type f -perm -g+s -print

Or a combo using logical OR

find /top_dir -type f ( -perm -u+s -o -perm -g+s ) -print

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Jeff Schussele
Honored Contributor

Re: Which files have run as user/group execution bit set ?

Forgot to escape my parens

find /top_dir -type f \( -perm -u+s -o -perm -g+s \) -print

Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!