How do I find all files that are *not* group writeable?

I see the following question describing how to find group writeable files: How can I find all PHP files with group write permissions?

But I want files that are not group writable! (Also, I couldn't comment on the above question).

Google lets me down (as 'find' isn't such a unique keyword).


Solution 1:

Assuming that the linked question would run on your system, you can invert the match with !:

find ! -perm -g=w

Also, you can read the documentation for find by looking into the manpages:

man find

Solution 2:

On BSD derived Unix system (macOS, FreeBSD, ...) you need to add a path to find. So for a more compatible version add . to search in the current directory and ! to invert the match:

find . ! -perm -g=w