find /home -group NOT test
find /home -not -group test
或find /home ! -group test
find /home ! -group test
惊叹号反转了比赛。 从man find
:
! expr True if expr is false. This character will also usually need -not expr Same as ! expr, but not POSIX compliant.
如果你想要它属于输出的组:
find /home ! -group test -printf "%p:%g\n" ./lots/573:root ...
有关使用find的更多信息:
如何掌握UNIX查找命令?
做一个grep排除你不想要的东西?