How can I find all PHP files with group write permissions?

1

I've been trying to get the -perm option of find to give me all PHP files that are group writable. Should this work?

find -name "*.php" -perm g-w

Thanks!

Kristopher Ives

Posted 2010-06-23T18:47:53.267

Reputation: 121

Answers

4

Try:

find -iname "*.php" -perm -g=w

-g=w means look for files that have this permission set.

BloodPhilia

Posted 2010-06-23T18:47:53.267

Reputation: 27 374

1May want -iname just in case some are .PHP for some bizzare reason. – Daenyth – 2010-06-23T19:01:56.653

@daenyth - Good point! Added it to my answer! +1 – BloodPhilia – 2010-06-23T19:06:12.703

@kristopher - You're very welcome! – BloodPhilia – 2010-06-23T21:34:42.677