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

12,177

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
Share:
12,177

Related videos on Youtube

Dan Bolser
Author by

Dan Bolser

Updated on September 18, 2022

Comments

  • Dan Bolser
    Dan Bolser almost 2 years

    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).

  • ualinker
    ualinker almost 10 years
    The full command to start searching within current directory would be find . ! -perm -g=w