linux - 特定组拥有的字符串的 GREP

标签 linux grep file-ownership

我需要做这样的事情

grep -R 'MyString' dir/

但是我不想在目录中搜索,而是想搜索特定组拥有的所有文件。这可能吗?

最佳答案

使用 find-group 选项,如下所示:

find mydir -group mygroup -type f -print0 | xargs -0 grep MyString

关于linux - 特定组拥有的字符串的 GREP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24019263/

相关文章:

linux - 如何同时使用 Parallel::ForkManager 和 Capture::Tiny?

linux - 如何 Grep 信息和结果在列中(Linux)

linux - 阻止用户查看公用文件夹

windows - 如何在 Windows 中取得多个文件的所有权?

linux - 适用于 Windows 的 XDG Basedir 目录

linux - sed 替换为十六进制

linux - update-rc.d : error: firewall Default-Start contains no runlevels, 正在中止

python - 使用 Python 在非常大的文件中查找字节序列

python - 来自 python 的 grep 命令

linux - 设置 javascript 文件只对 root 可写