查找不属于组的文件

Mic*_*ael 14 linux find groups

如何查找不属于特定组的文件?

find /home -group NOT test
Run Code Online (Sandbox Code Playgroud)

Kyl*_*ndt 21

find /home -not -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.
Run Code Online (Sandbox Code Playgroud)

如果你想要它在输出中属于的组:

find /home ! -group test -printf "%p:%g\n"
./lots/573:root
...
Run Code Online (Sandbox Code Playgroud)

有关使用 find 的更多信息:
如何掌握 UNIX find 命令?