GREP for String owned by a certain group
-
21-12-2019 - |
Question
I need to do something like this
grep -R 'MyString' dir/
But instead of searching within a directory, I'd like to search all files owned by a specific group. Is this possible?
Solution
Use the -group
option of find
as shown below:
find mydir -group mygroup -type f -print0 | xargs -0 grep MyString
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow