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:
Do a grep excluding the things you don't want?
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
By posting your answer, you agree to the
terms of service.
3 years ago