Score:-4

find all files and folders which have specific owner/group with grep

it flag

In home/oracle I have many files and folders.

I need 2 different codes to:

  • find (show) all files and folders belongs to user "Jim" from group "app"
  • Change user owner of all files and folders from (Jim) to Harry.

Is it possible to do it with grep?

Score:1
it flag

Read man find xargs chown and do something like (Untested)

find /home/oracle \( -user Jim -a -group app \) -print0 | \
  xargs -0 --no-run-if-empty \
    echo sudo chown Harry

Remove the echo after testing.

You can't do it with grep. grep searches the content of files, you want to check and modify the files' metadata.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.