Operating System - HP-UX
1753796 Members
7087 Online
108799 Solutions
New Discussion юеВ

How to find world writable directories by "find" command?

 
SOLVED
Go to solution
Sandip Ghosh
Honored Contributor

How to find world writable directories by "find" command?

Hi,

Quick Question.

How to find world writable directories by "find" command?

Many thanks in advance.

Sandip
Good Luck!!!
7 REPLIES 7
Patrick Wallek
Honored Contributor
Solution

Re: How to find world writable directories by "find" command?

Try this:

# find /dir -type d -perm -002
Sandip Ghosh
Honored Contributor

Re: How to find world writable directories by "find" command?

Thanks Patrick. I was missing -type d.

Now it works fine.

find / -type d -perm 777 -print

Thanks,

Sandip
Good Luck!!!
Patrick Wallek
Honored Contributor

Re: How to find world writable directories by "find" command?

Now keep in mind that you can have a world writeable directory without the permissions being 777. The example I gave will find anything with the world write bit set, whereas your example would find ONLY those with 777 permissions.
Michael D'Aulerio
Regular Advisor

Re: How to find world writable directories by "find" command?

Sandip,

You can also try:

find / -type d -perm -a+w

This will check for write permission regardless of what the read or execute permission is.

Mike D'.
Email: michael.n.daulerio@lmco.com
Mani Pushpanathan
Occasional Contributor

Re: How to find world writable directories by "find" command?

Hi,
THis command just lists out the file name with dir path. What if I want to list out the perm settings as well? Appreciate if someone can reply this. thanks

Mani
MarkSyder
Honored Contributor

Re: How to find world writable directories by "find" command?

Replace -print with -exec ll -d {} \;

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
MarkSyder
Honored Contributor

Re: How to find world writable directories by "find" command?

I've just noticed the age of this thread and that Mani isn't the author. Mani, have you thought of starting your own thread so you can give points to the people who help you?

Mark
The triumph of evil requires only that good men do nothing