Operating System - HP-UX
1838634 Members
2327 Online
110128 Solutions
New Discussion

How to find all files that have world writable to them ?

 
SOLVED
Go to solution
Mark Blonde
Advisor

How to find all files that have world writable to them ?

Good Afternoon All,
I was wondering what would be the best way or command that you could do a global search and find all the files that have world writable on them ?

Thanks,
If you don't have what you want, want what you have.
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor
Solution

Re: How to find all files that have world writable to them ?

Hi:

Without regard to other permission combinations or write access permissions, other than as requested, do:

# find /tmp -type f -perm -o=w -exec ls -als {} \;

Note that only 'f'iles are returned, not directories, too.

See the 'find' and 'chmod' man pages for more information.

Regards!

...JRF...
Sanjay_6
Honored Contributor

Re: How to find all files that have world writable to them ?

Hi Mark,

Use the find command with the perm option.

Try,

find / -perm -o=w -exec ll {} \;

Hope this helps.

Regds
A. Clay Stephenson
Acclaimed Contributor

Re: How to find all files that have world writable to them ?

Something like this:

1) cd to desired directory:
2) find . -type f -perm -002

NOTE: Don't use -perm 002 because that will only find files that are -------w- (002).

I do not suggest that you do this from / because that will impose a significant load on your system.
If it ain't broke, I can fix that.