How do I recursively run "chgrp" without changing the group if it matches a specific group?
6
votes
2
answers
5060
views
I just copied all the files/subdirectories in my home directory to another user's home directory.
Then I did a recursive
chown
on his home directory, so that he became the owner of all his files/subdirectories.
The last thing I need to do is a recursive chgrp
on his home directory, so that his username will be the group for all his files/subdirectories, instead of my username.
The issue is that there are a couple of subdirectories whose group is "docker". Inside these subdirectories, there are some files/directories whose group is my username, and some other files/directories whose group is "docker".
How do I recursively run chgrp
on his home directory so that every single file/subdirectory whose group is my username gets changed to his username, but every single file/subdirectory whose group is "docker" stays "docker"?
Asked by pacoverflow
(278 rep)
Sep 29, 2021, 03:40 PM
Last activity: Oct 2, 2021, 06:40 PM
Last activity: Oct 2, 2021, 06:40 PM