简体   繁体   English

递归查找未设置setgid的目录

[英]recursively find directories without setgid set

In linux, how do you recursively pull up a list of all directories that do NOT have the setgid bit set? 在Linux中,如何递归提取未设置setgid位的所有目录的列表?

I know you can do 我知道你能做

find . -type d /perm g+s

to find all the directories that have it set, but it's not obvious to me how to negate this. 查找设置了该目录的所有目录,但是对我而言,如何取反并不很明显。 Or if another tool is more appropriate for this use case. 或者,如果另一个工具更适合此用例。

I've got a rather large directory tree and I'm trying to limit the operations I do on them. 我有一个相当大的目录树,我试图限制对它们的操作。

You can simply add \\! 您可以简单地添加\\! before an expression in find in order to negate it. 查找表达式之前将其取反。

find . -type d \! -perm -g+s

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM