How do I find files not belonging to particular group?
find /home -group NOT test
find /home -not -group test or find /home ! -group test
find /home -not -group test
find /home ! -group test
The exclamation inverts the match. From man find:
! expr True if expr is false. This character will also usually need
Same as ! expr, but not POSIX compliant.
If you want the group it does belong to in the output:
find /home ! -group test -printf "%p:%g\n"
Some more information on using find:
Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).
Do a grep excluding the things you don't want?
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
6 years ago
2 years ago