linux - CIS 文档中的 Bash 语法错误

标签 linux bash centos find xargs

我正在努力按照 CIS 标准第 9.1.12 节 (CentOS 6) 的要求进行更改。以下命令返回语法错误:

df --local -P | awk {'if (NR!=1) print $6'} | xargs -I '{}' find '{}' -xdev -group -ls

我得到的错误是:

find: `-ls' is not the name of an existing group
find: `-ls' is not the name of an existing group
find: `-ls' is not the name of an existing group

有人可以告诉我这个语法有什么问题吗?重点是查找并打印未分组的文件和目录。提前致谢。

最佳答案

-group 选项需要一个参数。例如,-group ichtys 可查找 ichtys 组拥有的文件。您似乎正在寻找 -nogroup 选项。

关于linux - CIS 文档中的 Bash 语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28289130/

相关文章:

linux - 如何将 gdb 附加到剥离的 sshd 服务器?

linux - 是否有任何现代文件系统支持任意元数据处理?

linux - 访问控制台内容

linux - awk 仅在 uniq 列中打印行数

php - ImageMagick convert 在命令行中工作,但不能通过 PHP exec()

linux - 运行 bash 并查看脚本中 echo 的打印结果

linux - 如何为Shell脚本套件创建Docker镜像

php - 从 php 与终端程序交互?

java - java.lang.UnsatisfiedLinkError:否GurobiJni/Tomcat

linux - Varnish 停止工作并在启动 OK 后死亡